a=sorted([(int(input()),chr(ord('A')+i)) for i in range(3)],reverse=True) for i in range(3): print(a[i][1])