m = ['A', 'B', 'C'] n = [int(input()) for _ in range(3)] l = [[m[i], n[i]] for i in range(3)] l = sorted(l, key = lambda x: -x[1]) for i in l: print(i[0])