n=[int(input()) for _ in range(3)] t='ABC' for i in sorted(n)[::-1]: print(t[n.index(i)])