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