H = [] name = ["A","B","C"] for n in name: h = int(input()) H.append((h,n)) H.sort(reverse=True) for h in H: print(h[1])