_, *sp = open(0).read().split()
for _, _, a in sorted([(s, -int(p), i + 1) for i, (s, p) in enumerate(zip(*[iter(sp)] * 2))]):
    print(a) _, *sp = open(0).read().split() _ open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *sp sp for _, _, a in sorted([(s, -int(p), i + 1) for i, (s, p) in enumerate(zip(*[iter(sp)] * 2))]):
    print(a) _ _ a sorted([(s, -int(p), i + 1) for i, (s, p) in enumerate(zip(*[iter(sp)] * 2))]) sorted [(s, -int(p), i + 1) for i, (s, p) in enumerate(zip(*[iter(sp)] * 2))] print(a) print a _, *sp = open(0).read().split() open(0).read().split() _
_, *sp = open(0).read().split()
for _, _, a in sorted([(s, -int(p), i + 1) for i, (s, p) in enumerate(zip(*[iter(sp)] * 2))]):
    print(a)