a = ord("A") H = [(chr(a + i),int(input())) for i in range(3)] H.sort(key=lambda x:x[1],reverse=True) for name,h in H: print(name)