N=int(input())
L=[list(input().split())+[i+1] for i in range(N)]
L=[[l[0],int(l[1]),l[2]] for l in L]
L.sort(key=lambda x: x[1],reverse=True)
L.sort(key=lambda x: x[0])
for l in L:
  print(l[2]) N=int(input()) N int(input()) int input() input list(input().split())+[i+1] for i in range(N) for i in range(N) i range(N) range N for i in range(N) list(input().split())+[i+1] list(input().split()) list input().split() ().split () input split [i+1] i+1 i 1 L=[list(input().split())+[i+1] for i in range(N)] L [list(input().split())+[i+1] for i in range(N)] [l[0],int(l[1]),l[2]] for l in L for l in L l L for l in L [l[0],int(l[1]),l[2]] l[0] l 0 int(l[1]) int l[1] l 1 l[2] l 2 L=[[l[0],int(l[1]),l[2]] for l in L] L [[l[0],int(l[1]),l[2]] for l in L] L.sort(key=lambda x: x[1],reverse=True) L.sort L sort key=lambda x: x[1] key lambda x: x[1] x[1] x 1 x reverse=True reverse True L.sort(key=lambda x: x[0]) L.sort L sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x for l in L:
  print(l[2]) l L print(l[2]) print l[2] l 2 L=[list(input().split())+[i+1] for i in range(N)] [list(input().split())+[i+1] for i in range(N)] L N=int(input()) int(input()) N L=[[l[0],int(l[1]),l[2]] for l in L] [[l[0],int(l[1]),l[2]] for l in L] L
N=int(input())
L=[list(input().split())+[i+1] for i in range(N)]
L=[[l[0],int(l[1]),l[2]] for l in L]
L.sort(key=lambda x: x[1],reverse=True)
L.sort(key=lambda x: x[0])
for l in L:
  print(l[2])