n = int(input())
spi = sorted([list(input().split())+[i+1] for i in range(n)])
ans = []
before = ""
for s,p,i in spi:
    if ans == []:
        ans = [[int(p),i]]
        before = s
    else:
        if before == s:
            ans.append([int(p),i])
        else:
            for j in sorted(ans)[::-1]: print(j[1])
            ans = [[int(p),i]]
            before = s
if ans:
    for i in sorted(ans)[::-1]: print(i[1]) n = int(input()) n int(input()) int input() input list(input().split())+[i+1] for i in range(n) for i in range(n) i range(n) range n for i in range(n) list(input().split())+[i+1] list(input().split()) list input().split() ().split () input split [i+1] i+1 i 1 spi = sorted([list(input().split())+[i+1] for i in range(n)]) spi sorted([list(input().split())+[i+1] for i in range(n)]) sorted [list(input().split())+[i+1] for i in range(n)] ans = [] ans [] before = "" before "" for s,p,i in spi:
    if ans == []:
        ans = [[int(p),i]]
        before = s
    else:
        if before == s:
            ans.append([int(p),i])
        else:
            for j in sorted(ans)[::-1]: print(j[1])
            ans = [[int(p),i]]
            before = s s p i spi if ans == []:
        ans = [[int(p),i]]
        before = s
    else:
        if before == s:
            ans.append([int(p),i])
        else:
            for j in sorted(ans)[::-1]: print(j[1])
            ans = [[int(p),i]]
            before = s ans == [] ans [] ans = [[int(p),i]] ans [[int(p),i]] [int(p),i] int(p) int p i before = s before s if before == s:
            ans.append([int(p),i])
        else:
            for j in sorted(ans)[::-1]: print(j[1])
            ans = [[int(p),i]]
            before = s before == s before s ans.append([int(p),i]) ans.append ans append [int(p),i] int(p) int p i for j in sorted(ans)[::-1]: print(j[1])
             j sorted(ans)[::-1] (ans) sorted ans ::-1 -1 ans = [[int(p),i]] ans [[int(p),i]] [int(p),i] int(p) int p i before = s before s if ans:
    for i in sorted(ans)[::-1]: print(i[1]) ans for i in sorted(ans)[::-1]: print(i[1]) i sorted(ans)[::-1] (ans) sorted ans ::-1 -1 ans = [[int(p),i]] [[int(p),i]] ans n = int(input()) int(input()) n ans = [[int(p),i]] [[int(p),i]] ans before = s s before before = s s before spi = sorted([list(input().split())+[i+1] for i in range(n)]) sorted([list(input().split())+[i+1] for i in range(n)]) spi ans = [] [] ans before = "" "" before
n = int(input())
spi = sorted([list(input().split())+[i+1] for i in range(n)])
ans = []
before = ""
for s,p,i in spi:
    if ans == []:
        ans = [[int(p),i]]
        before = s
    else:
        if before == s:
            ans.append([int(p),i])
        else:
            for j in sorted(ans)[::-1]: print(j[1])
            ans = [[int(p),i]]
            before = s
if ans:
    for i in sorted(ans)[::-1]: print(i[1])