n = int(input())
base_li = [0]*n

for i in range(n):
    l, p = input().split()
    base_li[i] = [i+1, (l, -int(p))]

sl = sorted(base_li, key=lambda w: w[1])
for c in sl:
    print(c[0]) n = int(input()) n int(input()) int input() input base_li = [0]*n base_li [0]*n [0] 0 n for i in range(n):
    l, p = input().split()
    base_li[i] = [i+1, (l, -int(p))] i range(n) range n l, p = input().split() l input().split() ().split () input split p base_li[i] = [i+1, (l, -int(p))] base_li[i] base_li i [i+1, (l, -int(p))] i+1 i 1 (l, -int(p)) l -int(p) int(p) int p sl = sorted(base_li, key=lambda w: w[1]) sl sorted(base_li, key=lambda w: w[1]) sorted base_li key=lambda w: w[1] key lambda w: w[1] w[1] w 1 w for c in sl:
    print(c[0]) c sl print(c[0]) print c[0] c 0 base_li = [0]*n [0]*n base_li sl = sorted(base_li, key=lambda w: w[1]) sorted(base_li, key=lambda w: w[1]) sl l, p = input().split() input().split() l n = int(input()) int(input()) n p = input().split() input().split() p
n = int(input())
base_li = [0]*n

for i in range(n):
    l, p = input().split()
    base_li[i] = [i+1, (l, -int(p))]

sl = sorted(base_li, key=lambda w: w[1])
for c in sl:
    print(c[0])
