N = int(input())
lst = []
for i in range(N):
  s, p = input().split()
  lst.append([s, int(p), i+1])
lst = sorted(lst, key = lambda x: x[1], reverse=True)
lst = sorted(lst, key = lambda x: x[0])
for j in range(N):
  print(lst[j][2], end=" ") N = int(input()) N int(input()) int input() input lst = [] lst [] for i in range(N):
  s, p = input().split()
  lst.append([s, int(p), i+1]) i range(N) range N s, p = input().split() s input().split() ().split () input split p lst.append([s, int(p), i+1]) lst.append lst append [s, int(p), i+1] s int(p) int p i+1 i 1 lst = sorted(lst, key = lambda x: x[1], reverse=True) lst sorted(lst, key = lambda x: x[1], reverse=True) sorted lst key = lambda x: x[1] key lambda x: x[1] x[1] x 1 x reverse=True reverse True lst = sorted(lst, key = lambda x: x[0]) lst sorted(lst, key = lambda x: x[0]) sorted lst key = lambda x: x[0] key lambda x: x[0] x[0] x 0 x for j in range(N):
  print(lst[j][2], end=" ") j range(N) range N print(lst[j][2], end=" ") print lst[j][2] [j] lst j 2 end=" " end " " s, p = input().split() input().split() s lst = [] [] lst lst = sorted(lst, key = lambda x: x[0]) sorted(lst, key = lambda x: x[0]) lst N = int(input()) int(input()) N p = input().split() input().split() p lst = sorted(lst, key = lambda x: x[1], reverse=True) sorted(lst, key = lambda x: x[1], reverse=True) lst
N = int(input())
lst = []
for i in range(N):
  s, p = input().split()
  lst.append([s, int(p), i+1])
lst = sorted(lst, key = lambda x: x[1], reverse=True)
lst = sorted(lst, key = lambda x: x[0])
for j in range(N):
  print(lst[j][2], end=" ")