a = int(input()) b = int(input()) c = int(input()) L = [ ["A",a], ["B",b], ["C",c] ] L = sorted(L,key=lambda x:x[1],reverse=True) for i in range(3) : print(L[i][0])