Sorting is a subroutine in many algorithms. For example, before we perform Graham's convex hull algorithm, we need to first sort the points by their polar angles.
In this problem, you will read in a list of list of numbers. You have to sort each list individually, then sort the list of lists.
Input
First line of input will be two integers, N and M. You may assume N and M are both smaller than 200.
Following that, each of the next N lines will contain the list of M numbers.
Output
Output the list of list of numbers, in ascending order of the list, where each list has its numbers in ascending order.
Sample Input 1
3 3
1 1 2
3 2 1
2 3 4
Sample Output 1
1 1 2
1 2 3
2 3 4