n = int(input())
xs = [0] * n
for i in range(n):
    s, p = input().split()
    xs[i] = [s, int(p), i + 1]
xs.sort(key=lambda v: (v[0], 100 - v[1]))
print(*map(lambda v: v[2], xs), sep="\n") n = int(input()) n int(input()) int input() input xs = [0] * n xs [0] * n [0] 0 n for i in range(n):
    s, p = input().split()
    xs[i] = [s, int(p), i + 1] i range(n) range n s, p = input().split() s input().split() ().split () input split p xs[i] = [s, int(p), i + 1] xs[i] xs i [s, int(p), i + 1] s int(p) int p i + 1 i 1 xs.sort(key=lambda v: (v[0], 100 - v[1])) xs.sort xs sort key=lambda v: (v[0], 100 - v[1]) key lambda v: (v[0], 100 - v[1]) (v[0], 100 - v[1]) v[0] v 0 100 - v[1] 100 v[1] v 1 v print(*map(lambda v: v[2], xs), sep="\n") print *map(lambda v: v[2], xs) map(lambda v: v[2], xs) map lambda v: v[2] v[2] v 2 v xs sep="\n" sep "\n" xs = [0] * n [0] * n xs p = input().split() input().split() p n = int(input()) int(input()) n s, p = input().split() input().split() s
n = int(input())
xs = [0] * n
for i in range(n):
    s, p = input().split()
    xs[i] = [s, int(p), i + 1]
xs.sort(key=lambda v: (v[0], 100 - v[1]))
print(*map(lambda v: v[2], xs), sep="\n")
