n = int(input())
a = [input().split() for i in range(n)]
for i in range(n):
    a[i][1] = int(a[i][1])
    a[i].append(i + 1)
a.sort()
for i in range(100):
    for j in range(1,n):
        if a[j][0] == a[j-1][0] and a[j][1] > a[j-1][1]:
            a[j-1],a[j] = a[j],a[j-1]
for i in range(n):
    print(a[i][2]) n = int(input()) n int(input()) int input() input input().split() for i in range(n) for i in range(n) i range(n) range n for i in range(n) input().split() ().split () input split a = [input().split() for i in range(n)] a [input().split() for i in range(n)] for i in range(n):
    a[i][1] = int(a[i][1])
    a[i].append(i + 1) i range(n) range n a[i][1] = int(a[i][1]) a[i][1] [i] a i 1 int(a[i][1]) int a[i][1] [i] a i 1 a[i].append(i + 1) [i].append [i] a i append i + 1 i 1 a.sort() a.sort a sort for i in range(100):
    for j in range(1,n):
        if a[j][0] == a[j-1][0] and a[j][1] > a[j-1][1]:
            a[j-1],a[j] = a[j],a[j-1] i range(100) range 100 for j in range(1,n):
        if a[j][0] == a[j-1][0] and a[j][1] > a[j-1][1]:
            a[j-1],a[j] = a[j],a[j-1] j range(1,n) range 1 n if a[j][0] == a[j-1][0] and a[j][1] > a[j-1][1]:
            a[j-1],a[j] = a[j],a[j-1] a[j][0] == a[j-1][0] and a[j][1] > a[j-1][1] a[j][0] == a[j-1][0] a[j][0] [j] a j 0 a[j-1][0] [j-1] a j-1 j 1 0 a[j][1] > a[j-1][1] a[j][1] [j] a j 1 a[j-1][1] [j-1] a j-1 j 1 1 a[j-1],a[j] = a[j],a[j-1] a[j-1] a j-1 j 1 a[j] a j a[j] a j a[j-1] a j-1 j 1 for i in range(n):
    print(a[i][2]) i range(n) range n print(a[i][2]) print a[i][2] [i] a i 2 n = int(input()) int(input()) n a = [input().split() for i in range(n)] [input().split() for i in range(n)] a
n = int(input())
a = [input().split() for i in range(n)]
for i in range(n):
    a[i][1] = int(a[i][1])
    a[i].append(i + 1)
a.sort()
for i in range(100):
    for j in range(1,n):
        if a[j][0] == a[j-1][0] and a[j][1] > a[j-1][1]:
            a[j-1],a[j] = a[j],a[j-1]
for i in range(n):
    print(a[i][2])