Sort:  

Yes, it's rather complicated problem :)