lst = [[0, 'A'],[0, 'B'], [0, 'C']] for i in range(3): a = int(input()) lst[i][0] = a sort(lst, reverse = True) for i, c in lst: print(c)