N = int(input())
S_and_P_and_res_num = [['', 0, 0] for _ in range(N)]
for i in range(N):
    s, p = input().split()
    S_and_P_and_res_num[i][0] = s
    S_and_P_and_res_num[i][1] = int(p)
    S_and_P_and_res_num[i][2] = i + 1
S_and_P_and_res_num.sort(key=lambda x: (x[0], -x[1]))
[print(S_and_P_and_res_num[i][2]) for i in range(N)] N = int(input()) N int(input()) int input() input ['', 0, 0] for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) ['', 0, 0] '' 0 0 S_and_P_and_res_num = [['', 0, 0] for _ in range(N)] S_and_P_and_res_num [['', 0, 0] for _ in range(N)] for i in range(N):
    s, p = input().split()
    S_and_P_and_res_num[i][0] = s
    S_and_P_and_res_num[i][1] = int(p)
    S_and_P_and_res_num[i][2] = i + 1 i range(N) range N s, p = input().split() s input().split() ().split () input split p S_and_P_and_res_num[i][0] = s S_and_P_and_res_num[i][0] [i] S_and_P_and_res_num i 0 s S_and_P_and_res_num[i][1] = int(p) S_and_P_and_res_num[i][1] [i] S_and_P_and_res_num i 1 int(p) int p S_and_P_and_res_num[i][2] = i + 1 S_and_P_and_res_num[i][2] [i] S_and_P_and_res_num i 2 i + 1 i 1 S_and_P_and_res_num.sort(key=lambda x: (x[0], -x[1])) S_and_P_and_res_num.sort S_and_P_and_res_num sort key=lambda x: (x[0], -x[1]) key lambda x: (x[0], -x[1]) (x[0], -x[1]) x[0] x 0 -x[1] x[1] x 1 x print(S_and_P_and_res_num[i][2]) for i in range(N) for i in range(N) i range(N) range N for i in range(N) print(S_and_P_and_res_num[i][2]) print S_and_P_and_res_num[i][2] [i] S_and_P_and_res_num i 2 [print(S_and_P_and_res_num[i][2]) for i in range(N)] p = input().split() input().split() p N = int(input()) int(input()) N S_and_P_and_res_num = [['', 0, 0] for _ in range(N)] [['', 0, 0] for _ in range(N)] S_and_P_and_res_num s, p = input().split() input().split() s
N = int(input())
S_and_P_and_res_num = [['', 0, 0] for _ in range(N)]
for i in range(N):
    s, p = input().split()
    S_and_P_and_res_num[i][0] = s
    S_and_P_and_res_num[i][1] = int(p)
    S_and_P_and_res_num[i][2] = i + 1
S_and_P_and_res_num.sort(key=lambda x: (x[0], -x[1]))
[print(S_and_P_and_res_num[i][2]) for i in range(N)]
