p = ['A','B','C'] h = {} for i in p: h[i] = int(input()) for k, v in sorted(h.items(), key=lambda x: -x[1]): print(k)