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