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