Files
kattis/cups.py
2023-07-16 23:01:00 +02:00

17 lines
358 B
Python

n = int(input())
cups = {}
for _ in range(n):
tokens = input().split()
try:
value = int(tokens[0]) / 2
color = tokens[1]
except ValueError:
value = int(tokens[1])
color = tokens[0]
cups[color] = value
vals = sorted(cups.values())
for val in vals:
print(list(cups.keys())[list(cups.values()).index(val)])