N = int(input())
SP = [None] * N
for i in range(N):
    SP[i] = input().split() + [i + 1]
    SP[i][1] = int(SP[i][1]) * (-1)

SP.sort(key = lambda x : (x[0], x[1]))
for i in range(N):
    print(SP[i][2]) N = int(input()) N int(input()) int input() input SP = [None] * N SP [None] * N [None] None N for i in range(N):
    SP[i] = input().split() + [i + 1]
    SP[i][1] = int(SP[i][1]) * (-1) i range(N) range N SP[i] = input().split() + [i + 1] SP[i] SP i input().split() + [i + 1] input().split() ().split () input split [i + 1] i + 1 i 1 SP[i][1] = int(SP[i][1]) * (-1) SP[i][1] [i] SP i 1 int(SP[i][1]) * (-1) int(SP[i][1]) int SP[i][1] [i] SP i 1 -1 SP.sort(key = lambda x : (x[0], x[1])) SP.sort SP 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 for i in range(N):
    print(SP[i][2]) i range(N) range N print(SP[i][2]) print SP[i][2] [i] SP i 2 N = int(input()) int(input()) N SP = [None] * N [None] * N SP
N = int(input())
SP = [None] * N
for i in range(N):
    SP[i] = input().split() + [i + 1]
    SP[i][1] = int(SP[i][1]) * (-1)

SP.sort(key = lambda x : (x[0], x[1]))
for i in range(N):
    print(SP[i][2])