Amazon interview question

Sort 2D matrix in O(mnlog(mn))