n = int(input())
a = []
for i in range(n):
    a.append(list(input().split()))
b = a
for i in range(n):
    b[i][1] = -int(b[i][1])
b = sorted(b)
for i in range(n):
    b[i][1] = -b[i][1]
    print(a.index(b[i])+1) n = int(input()) n int(input()) int input() input a = [] a [] for i in range(n):
    a.append(list(input().split())) i range(n) range n a.append(list(input().split())) a.append a append list(input().split()) list input().split() ().split () input split b = a b a for i in range(n):
    b[i][1] = -int(b[i][1]) i range(n) range n b[i][1] = -int(b[i][1]) b[i][1] [i] b i 1 -int(b[i][1]) int(b[i][1]) int b[i][1] [i] b i 1 b = sorted(b) b sorted(b) sorted b for i in range(n):
    b[i][1] = -b[i][1]
    print(a.index(b[i])+1) i range(n) range n b[i][1] = -b[i][1] b[i][1] [i] b i 1 -b[i][1] b[i][1] [i] b i 1 print(a.index(b[i])+1) print a.index(b[i])+1 a.index(b[i]) a.index a index b[i] b i 1 n = int(input()) int(input()) n a = [] [] a b = a a b b = sorted(b) sorted(b) b
n = int(input())
a = []
for i in range(n):
    a.append(list(input().split()))
b = a
for i in range(n):
    b[i][1] = -int(b[i][1])
b = sorted(b)
for i in range(n):
    b[i][1] = -b[i][1]
    print(a.index(b[i])+1)