def main(): d = {} d[input()] = "A" d[input()] = "B" d[input()] = "C" for _, name in sorted(d.items(), key=lambda x: x[0], reverse=True): print(name) main()