A = list(map(int,input().split())) B = list(map(int,input().split())) C = list(map(int,input().split())) dct = {"A":[A[0],A[1]], "B":[B[0],B[1]], "C":[C[0],C[1]]} for k, v in sorted(dct.items(), key=lambda x: -x[1][0]): print(k)