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