You are given a spreadsheet that contains a list of athletes and their details (such as age, height, weight and so on). You are required to sort the data based on the th attribute and print the final resulting table. Follow the example given below for better understanding.
Note that is indexed from to , where is the number of attributes.
Note: If two attributes are the same for different rows, for example, if two atheletes are of the same age, print the row that appeared first in the input.
The first line contains and separated by a space.
The next lines each contain elements.
The last line contains .
Print the lines of the sorted table. Each line should contain the space separated elements. Check the sample below for clarity.
Sample Input 0
5 310 2 57 1 09 9 91 23 126 5 91
Sample Output 0
7 1 010 2 56 5 99 9 91 23 12
The details are sorted based on the second attribute, since is zero-indexed.