p=[] for i in 'ABC': h = int(input()) p.append([h,i]) p.sort() p.reverse() for i in range(3):print(p[i][1])