You have records of employee name and salary.You have to sort the records on the basis of employee salary,if same then by employee name.
The first line consists of a number T denoting the number of test cases.Each test case will consist of a integer N denoting number of employees followed by the name and salary of the employee with spaces.
Each test case consists of a single line. It consists of the name and salary of the employees with spaces.
1<=Max length of name <= 100
1<= salary of employee <=10^6
xbnnskd 100 geek 50
shyam 50 ram 50
geek 50 xbnnskd 100
ram 50 shyam 50