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