diff --git a/cups.py b/cups.py new file mode 100644 index 0000000..5bd9ec1 --- /dev/null +++ b/cups.py @@ -0,0 +1,16 @@ +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)])