H = [[name, int(input())] for name in ['A', 'B', 'C']] H = sorted(H,reverse = True, key=lambda x: x[1]) for i in range(3): print(H[i][0])