a=sorted([list(map(int,input().split()))+[chr(65+i)] for i in range(3)],key=lambda x:(-x[0],x[1])) print(*[a[i][2] for i in range(3)])