n = int(input())
sp = [list([i+1]+list(input().split())) for i in range(n)]
sp2 = sorted(sp,key=lambda x:(x[1],-int(x[2])))
[print(ss[0]) for ss in sp2] n = int(input()) n int(input()) int input() input list([i+1]+list(input().split())) for i in range(n) for i in range(n) i range(n) range n for i in range(n) list([i+1]+list(input().split())) list [i+1]+list(input().split()) [i+1] i+1 i 1 list(input().split()) list input().split() ().split () input split sp = [list([i+1]+list(input().split())) for i in range(n)] sp [list([i+1]+list(input().split())) for i in range(n)] sp2 = sorted(sp,key=lambda x:(x[1],-int(x[2]))) sp2 sorted(sp,key=lambda x:(x[1],-int(x[2]))) sorted sp key=lambda x:(x[1],-int(x[2])) key lambda x:(x[1],-int(x[2])) (x[1],-int(x[2])) x[1] x 1 -int(x[2]) int(x[2]) int x[2] x 2 x print(ss[0]) for ss in sp2 for ss in sp2 ss sp2 for ss in sp2 print(ss[0]) print ss[0] ss 0 [print(ss[0]) for ss in sp2] sp2 = sorted(sp,key=lambda x:(x[1],-int(x[2]))) sorted(sp,key=lambda x:(x[1],-int(x[2]))) sp2 n = int(input()) int(input()) n sp = [list([i+1]+list(input().split())) for i in range(n)] [list([i+1]+list(input().split())) for i in range(n)] sp
n = int(input())
sp = [list([i+1]+list(input().split())) for i in range(n)]
sp2 = sorted(sp,key=lambda x:(x[1],-int(x[2])))
[print(ss[0]) for ss in sp2]