N = int(input())
SP = [list(input().split()) for _ in range(N)]

for i in range(N):
    SP[i].append(i+1)
  
ans = sorted(SP, key=lambda x:(x[0], -int(x[1])))

#for i in range(N):
#    print(ans[i][2])

for i in ans:
    print(i[2]) N = int(input()) N int(input()) int input() input list(input().split()) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(input().split()) list input().split() ().split () input split SP = [list(input().split()) for _ in range(N)] SP [list(input().split()) for _ in range(N)] for i in range(N):
    SP[i].append(i+1)
   i range(N) range N SP[i].append(i+1) [i].append [i] SP i append i+1 i 1 ans = sorted(SP, key=lambda x:(x[0], -int(x[1]))) ans sorted(SP, key=lambda x:(x[0], -int(x[1]))) sorted SP key=lambda x:(x[0], -int(x[1])) key lambda x:(x[0], -int(x[1])) (x[0], -int(x[1])) x[0] x 0 -int(x[1]) int(x[1]) int x[1] x 1 x for i in ans:
    print(i[2]) i ans print(i[2]) print i[2] i 2 SP = [list(input().split()) for _ in range(N)] [list(input().split()) for _ in range(N)] SP N = int(input()) int(input()) N ans = sorted(SP, key=lambda x:(x[0], -int(x[1]))) sorted(SP, key=lambda x:(x[0], -int(x[1]))) ans
N = int(input())
SP = [list(input().split()) for _ in range(N)]

for i in range(N):
    SP[i].append(i+1)
  
ans = sorted(SP, key=lambda x:(x[0], -int(x[1])))

#for i in range(N):
#    print(ans[i][2])

for i in ans:
    print(i[2])