n = int(input())

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

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