n = int(input())
r = []
for i in range(n):
    s,p = input().split()
    p = -int(p)
    r.append([s,p,i])
a = sorted(r)
for i in range(n):
    print(a[i][2]+1) n = int(input()) n int(input()) int input() input r = [] r [] for i in range(n):
    s,p = input().split()
    p = -int(p)
    r.append([s,p,i]) i range(n) range n s,p = input().split() s input().split() ().split () input split p p = -int(p) p -int(p) int(p) int p r.append([s,p,i]) r.append r append [s,p,i] s p i a = sorted(r) a sorted(r) sorted r for i in range(n):
    print(a[i][2]+1) i range(n) range n print(a[i][2]+1) print a[i][2]+1 a[i][2] [i] a i 2 1 s,p = input().split() input().split() s p = -int(p) -int(p) p r = [] [] r p = input().split() input().split() p a = sorted(r) sorted(r) a n = int(input()) int(input()) n
n = int(input())
r = []
for i in range(n):
    s,p = input().split()
    p = -int(p)
    r.append([s,p,i])
a = sorted(r)
for i in range(n):
    print(a[i][2]+1)
