L = [[int(input()), i+1] for i in range(3)] L = sorted(L)[::-1] for j in range(3): print('XABC'[L[j][1]])