n = int(input())
restaurants = []
for i in range(n):
    s, p = input().split()
    restaurants.append((s, int(p)))
sorted_list = sorted(restaurants, key=lambda x:x[1], reverse=True)
sorted_list.sort(key=lambda x:x[0])

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

for i in range(n):
    print(restaurants.index(sorted_list[i]) + 1)