d = {} d["A"] = int(input()) d["B"] = int(input()) d["C"] = int(input()) for k in sorted(d.items(), key=lambda x: x[1], reverse=True): print(k[0])