N = int(input())
L = [0] * N
for i in range(N):
  s, p = map(str, input().split())
  p = -1 * int(p)
  L[i] = [s, p, i + 1]
L = sorted(L)
#print(L)
for i in range(N):
  print(L[i][2]) N = int(input()) N int(input()) int input() input L = [0] * N L [0] * N [0] 0 N for i in range(N):
  s, p = map(str, input().split())
  p = -1 * int(p)
  L[i] = [s, p, i + 1] i range(N) range N s, p = map(str, input().split()) s map(str, input().split()) map str input().split() ().split () input split p p = -1 * int(p) p -1 * int(p) -1 int(p) int p L[i] = [s, p, i + 1] L[i] L i [s, p, i + 1] s p i + 1 i 1 L = sorted(L) L sorted(L) sorted L for i in range(N):
  print(L[i][2]) i range(N) range N print(L[i][2]) print L[i][2] [i] L i 2 L = [0] * N [0] * N L s, p = map(str, input().split()) map(str, input().split()) s L = sorted(L) sorted(L) L p = -1 * int(p) -1 * int(p) p N = int(input()) int(input()) N p = map(str, input().split()) map(str, input().split()) p
N = int(input())
L = [0] * N
for i in range(N):
  s, p = map(str, input().split())
  p = -1 * int(p)
  L[i] = [s, p, i + 1]
L = sorted(L)
#print(L)
for i in range(N):
  print(L[i][2])
