n = int(input())
sp = list([input().split() for i in range(n)])
sp2 =[[i] + sp[i] for i in range(n)]

ans = sorted(sp2, key= lambda x:int(x[2]), reverse=True)

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

ans = sorted(sp2, key= lambda x:int(x[2]), reverse=True)

ans2 = sorted(ans, key =lambda x:x[1])
for i in range(n):
  
  print(ans2[i][0] +1)