H = [int(input()), int(input()), int(input())] h = sorted(H, reverse=True) X = 'ABC' for i in range(3): print(X[H.index(h[i])])