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