for x in sorted([(input(),'A'),(input(),'B'),(input(),'C')])[::-1]:print(x[1])