n = int(input())
SP = [list(input().split()) for _ in range(n)]

SPN = [[s, int(p), i + 1] for i, (s, p) in enumerate(SP)]
SPN.sort(key=lambda x: (x[0], -x[1]))

for _, _, i in SPN:
  print(i) n = int(input()) n int(input()) int input() input list(input().split()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(input().split()) list input().split() ().split () input split SP = [list(input().split()) for _ in range(n)] SP [list(input().split()) for _ in range(n)] [s, int(p), i + 1] for i, (s, p) in enumerate(SP) for i, (s, p) in enumerate(SP) i (s, p) s p enumerate(SP) enumerate SP for i, (s, p) in enumerate(SP) [s, int(p), i + 1] s int(p) int p i + 1 i 1 SPN = [[s, int(p), i + 1] for i, (s, p) in enumerate(SP)] SPN [[s, int(p), i + 1] for i, (s, p) in enumerate(SP)] SPN.sort(key=lambda x: (x[0], -x[1])) SPN.sort SPN sort key=lambda x: (x[0], -x[1]) key lambda x: (x[0], -x[1]) (x[0], -x[1]) x[0] x 0 -x[1] x[1] x 1 x for _, _, i in SPN:
  print(i) _ _ i SPN print(i) print i SP = [list(input().split()) for _ in range(n)] [list(input().split()) for _ in range(n)] SP n = int(input()) int(input()) n SPN = [[s, int(p), i + 1] for i, (s, p) in enumerate(SP)] [[s, int(p), i + 1] for i, (s, p) in enumerate(SP)] SPN
n = int(input())
SP = [list(input().split()) for _ in range(n)]

SPN = [[s, int(p), i + 1] for i, (s, p) in enumerate(SP)]
SPN.sort(key=lambda x: (x[0], -x[1]))

for _, _, i in SPN:
  print(i)