H = [[int(input()), "ABC"[i]] for i in range(3)] H.sort(reverse=True) for h in H: print(h[1]);