print("\n".join(sorted({"A":int(input()),"B":int(input()),"C":int(input())},key=lambda x:x[1])[::-1]))