Given the grades of N people. Please output the sorted result. (Increasing order)
The input includes multiple test cases.
In each test case, the first line contains one integer N. The following N lines specify the name Si and the grade Gi.
1 <= N <= 105
1 <= |Si| <= 10
0 <= Gi <= 100 (Gi is an integer.)
For every test case, output the result in N lines. Every line contains the name and the grade. If more people’s grades are same, output by input order. (That means it uses stable sort.)