Start: Jul, 06, 2019 10:00:00
20190706Python程序设计基础培训扩展练习
End: Jul, 17, 2019 12:00:00
Time elapsed:
Time remaining:

Problem_ID: B
Result: Accepted
Time: 48ms
Memory: 25316kB
Author: 18605753875
In contest: 1300

t=int(input())
for tt in range(t):
    wh_n=int(input())
    wh_l=[]
    for wh_nn in range(wh_n):
        wh=input().split()
        wh_l.append({'s':wh[0],'n':int(wh[1])})
    wh_l=sorted(wh_l,key=lambda x:x['n'],reverse=True)
    for w in wh_l:
        print(w['s'])