brother = [["A"], ["B"], ["C"]] for i in range(3): brother[i].insert(0, int(input())) brother.sort(reverse = True) for i in range(3): print(brother[i][1])