N = int(input())
list1 = []
for i in range(N):
  aa = input().split()
  a = aa[0]
  b = -int(aa[1])
  xxx = [a,b,i]
  list1.append(xxx)
list1.sort()

for i in range(N):
  list1[i].append(i)

for i in range(N):
  for j in list1:
    if j[3] == i:
      print(j[2]+1) N = int(input()) N int(input()) int input() input list1 = [] list1 [] for i in range(N):
  aa = input().split()
  a = aa[0]
  b = -int(aa[1])
  xxx = [a,b,i]
  list1.append(xxx) i range(N) range N aa = input().split() aa input().split() ().split () input split a = aa[0] a aa[0] aa 0 b = -int(aa[1]) b -int(aa[1]) int(aa[1]) int aa[1] aa 1 xxx = [a,b,i] xxx [a,b,i] a b i list1.append(xxx) list1.append list1 append xxx list1.sort() list1.sort list1 sort for i in range(N):
  list1[i].append(i) i range(N) range N list1[i].append(i) [i].append [i] list1 i append i for i in range(N):
  for j in list1:
    if j[3] == i:
      print(j[2]+1) i range(N) range N for j in list1:
    if j[3] == i:
      print(j[2]+1) j list1 if j[3] == i:
      print(j[2]+1) j[3] == i j[3] j 3 i print(j[2]+1) print j[2]+1 j[2] j 2 1 aa = input().split() input().split() aa b = -int(aa[1]) -int(aa[1]) b a = aa[0] aa[0] a N = int(input()) int(input()) N list1 = [] [] list1 xxx = [a,b,i] [a,b,i] xxx
N = int(input())
list1 = []
for i in range(N):
  aa = input().split()
  a = aa[0]
  b = -int(aa[1])
  xxx = [a,b,i]
  list1.append(xxx)
list1.sort()

for i in range(N):
  list1[i].append(i)

for i in range(N):
  for j in list1:
    if j[3] == i:
      print(j[2]+1)