N  = int(input())
rs = [ [ *input().split(), n ] for n in range(N) ]

rs = sorted(
    [ (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs ],
    key=lambda t: t[0],
)

for r in rs:
    print(r[1]) N  = int(input()) N int(input()) int input() input [ *input().split(), n ] for n in range(N) for n in range(N) n range(N) range N for n in range(N) [ *input().split(), n ] *input().split() input().split() ().split () input split n rs = [ [ *input().split(), n ] for n in range(N) ] rs [ [ *input().split(), n ] for n in range(N) ] (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs for s, p, i in rs s p i rs for s, p, i in rs (f'{s}{100 - int(p):03}', i + 1) f'{s}{100 - int(p):03}' i + 1 i 1 rs = sorted(
    [ (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs ],
    key=lambda t: t[0],
) rs sorted(
    [ (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs ],
    key=lambda t: t[0],
) sorted [ (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs ] key=lambda t: t[0] key lambda t: t[0] t[0] t 0 t for r in rs:
    print(r[1]) r rs print(r[1]) print r[1] r 1 N  = int(input()) int(input()) N rs = sorted(
    [ (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs ],
    key=lambda t: t[0],
) sorted(
    [ (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs ],
    key=lambda t: t[0],
) rs rs = [ [ *input().split(), n ] for n in range(N) ] [ [ *input().split(), n ] for n in range(N) ] rs
N  = int(input())
rs = [ [ *input().split(), n ] for n in range(N) ]

rs = sorted(
    [ (f'{s}{100 - int(p):03}', i + 1) for s, p, i in rs ],
    key=lambda t: t[0],
)

for r in rs:
    print(r[1])