N=int(input())
S=[list(map(str,input().split())) for _ in range(N)]
for row in S:
    row[1]=int(row[1])
SS=sorted(S)
ins=0
ans=list()
tmp=0
for i in SS:
    if i[0]==tmp:
        ans.insert(ins,i)
    else:
        ins=len(ans)
        ans.append(i)
        tmp=i[0]
for j in ans:
    print(S.index(j)+1) N=int(input()) N int(input()) int input() input list(map(str,input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split S=[list(map(str,input().split())) for _ in range(N)] S [list(map(str,input().split())) for _ in range(N)] for row in S:
    row[1]=int(row[1]) row S row[1]=int(row[1]) row[1] row 1 int(row[1]) int row[1] row 1 SS=sorted(S) SS sorted(S) sorted S ins=0 ins 0 ans=list() ans list() list tmp=0 tmp 0 for i in SS:
    if i[0]==tmp:
        ans.insert(ins,i)
    else:
        ins=len(ans)
        ans.append(i)
        tmp=i[0] i SS if i[0]==tmp:
        ans.insert(ins,i)
    else:
        ins=len(ans)
        ans.append(i)
        tmp=i[0] i[0]==tmp i[0] i 0 tmp ans.insert(ins,i) ans.insert ans insert ins i ins=len(ans) ins len(ans) len ans ans.append(i) ans.append ans append i tmp=i[0] tmp i[0] i 0 for j in ans:
    print(S.index(j)+1) j ans print(S.index(j)+1) print S.index(j)+1 S.index(j) S.index S index j 1 SS=sorted(S) sorted(S) SS N=int(input()) int(input()) N S=[list(map(str,input().split())) for _ in range(N)] [list(map(str,input().split())) for _ in range(N)] S ins=0 0 ins tmp=0 0 tmp ins=len(ans) len(ans) ins ans=list() list() ans tmp=i[0] i[0] tmp
N=int(input())
S=[list(map(str,input().split())) for _ in range(N)]
for row in S:
    row[1]=int(row[1])
SS=sorted(S)
ins=0
ans=list()
tmp=0
for i in SS:
    if i[0]==tmp:
        ans.insert(ins,i)
    else:
        ins=len(ans)
        ans.append(i)
        tmp=i[0]
for j in ans:
    print(S.index(j)+1)