H=[0]*3 name=["A","B","C"] for i in range(3): H[i]=input() max=H.index(max(H)) min=H.index(min(H)) mid=(max+min) print(name[max]) print("".join(name[-mid])) print(name[min])