N = int(input())
D = [list(map(str,input().split())) for _ in range(N)]
for i in range(N):
  D[i].append(i+1)
sorted_d = sorted(D, key = lambda x: (x[0], -int(x[1])))
for i in range(N):
  print(sorted_d[i][2]) N = int(input()) N int(input()) int input() input list(map(str,input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split D = [list(map(str,input().split())) for _ in range(N)] D [list(map(str,input().split())) for _ in range(N)] for i in range(N):
  D[i].append(i+1) i range(N) range N D[i].append(i+1) [i].append [i] D i append i+1 i 1 sorted_d = sorted(D, key = lambda x: (x[0], -int(x[1]))) sorted_d sorted(D, key = lambda x: (x[0], -int(x[1]))) sorted D 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 range(N):
  print(sorted_d[i][2]) i range(N) range N print(sorted_d[i][2]) print sorted_d[i][2] [i] sorted_d i 2 N = int(input()) int(input()) N D = [list(map(str,input().split())) for _ in range(N)] [list(map(str,input().split())) for _ in range(N)] D sorted_d = sorted(D, key = lambda x: (x[0], -int(x[1]))) sorted(D, key = lambda x: (x[0], -int(x[1]))) sorted_d
N = int(input())
D = [list(map(str,input().split())) for _ in range(N)]
for i in range(N):
  D[i].append(i+1)
sorted_d = sorted(D, key = lambda x: (x[0], -int(x[1])))
for i in range(N):
  print(sorted_d[i][2])