a,b,c = int(input()), int(input()), int(input()) d = [a,b,c] list.sort(d, reverse = True) for i in range(3): print("A" if a == d[i] else ("B" if b == d[i] else "C"))