N = int(input())
line = []
for i in range(N):
    tmp = [j for j in input().split()]
    tmp[1] = -1 * int(tmp[1])
    tmp.append(i + 1)
    line.append(tmp)
line.sort()
for i in range(N):
    print(line[i][2]) N = int(input()) N int(input()) int input() input line = [] line [] for i in range(N):
    tmp = [j for j in input().split()]
    tmp[1] = -1 * int(tmp[1])
    tmp.append(i + 1)
    line.append(tmp) i range(N) range N j for j in input().split() for j in input().split() j input().split() ().split () input split for j in input().split() j tmp = [j for j in input().split()] tmp [j for j in input().split()] tmp[1] = -1 * int(tmp[1]) tmp[1] tmp 1 -1 * int(tmp[1]) -1 int(tmp[1]) int tmp[1] tmp 1 tmp.append(i + 1) tmp.append tmp append i + 1 i 1 line.append(tmp) line.append line append tmp line.sort() line.sort line sort for i in range(N):
    print(line[i][2]) i range(N) range N print(line[i][2]) print line[i][2] [i] line i 2 tmp = [j for j in input().split()] [j for j in input().split()] tmp N = int(input()) int(input()) N line = [] [] line
N = int(input())
line = []
for i in range(N):
    tmp = [j for j in input().split()]
    tmp[1] = -1 * int(tmp[1])
    tmp.append(i + 1)
    line.append(tmp)
line.sort()
for i in range(N):
    print(line[i][2])
