n = int(input())
s = [input().split() for _ in range(n)]
for i in range(n):
    s[i].append(i+1)

s = sorted(s,key=lambda x:int(x[1]),reverse=True)
s = sorted(s,key=lambda x:x[0])
for i in range(n):
    print(s[i][2]) n = int(input()) n int(input()) int input() input input().split() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input().split() ().split () input split s = [input().split() for _ in range(n)] s [input().split() for _ in range(n)] for i in range(n):
    s[i].append(i+1) i range(n) range n s[i].append(i+1) [i].append [i] s i append i+1 i 1 s = sorted(s,key=lambda x:int(x[1]),reverse=True) s sorted(s,key=lambda x:int(x[1]),reverse=True) sorted s key=lambda x:int(x[1]) key lambda x:int(x[1]) int(x[1]) int x[1] x 1 x reverse=True reverse True s = sorted(s,key=lambda x:x[0]) s sorted(s,key=lambda x:x[0]) sorted s key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x for i in range(n):
    print(s[i][2]) i range(n) range n print(s[i][2]) print s[i][2] [i] s i 2 s = sorted(s,key=lambda x:int(x[1]),reverse=True) sorted(s,key=lambda x:int(x[1]),reverse=True) s s = [input().split() for _ in range(n)] [input().split() for _ in range(n)] s s = sorted(s,key=lambda x:x[0]) sorted(s,key=lambda x:x[0]) s n = int(input()) int(input()) n
n = int(input())
s = [input().split() for _ in range(n)]
for i in range(n):
    s[i].append(i+1)

s = sorted(s,key=lambda x:int(x[1]),reverse=True)
s = sorted(s,key=lambda x:x[0])
for i in range(n):
    print(s[i][2])
