brt = [] for i in range(3): h,w = map(int,input().split()) brt.append([h,-w,i]) brt.sort() brt.reverse() for i in brt: print(["A","B","C"][i[2]])