a = int(input()) b = int(input()) c = int(input()) dict = {'A': a, 'B': b, 'C': c} res = sorted(dict.items(), key=lambda x:x[1], reverse=True) for w in res: print(w[0])