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 ins = len(ans) len(ans) ins ins = 0 0 ins tmp = 0 0 tmp ss = sorted(s) sorted(s) ss ans = list() list() ans s = [list(map(str, input().split())) for _ in range(n)] [list(map(str, input().split())) for _ in range(n)] s n = int(input()) int(input()) n 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)
