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