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