b=['A','B','C'] a=[int(input())for _ in range(3)] c=sorted(list(zip(a,b)))[::-1] for x,y in c: print(y)