H = {} H['A'] = int(input()) H['B'] = int(input()) H['C'] = int(input()) for k, v in sorted(H.items(), key=lambda x: -x[1]): print(k)