hw_list = [] for i in range(3): cur_list = [int(i) for i in input().split()] cur_list.insert(0, i) hw_list.append(cur_list) sorted_hw_list = sorted(hw_list, key=lambda x:x[2]) sorted_hw_list = sorted(sorted_hw_list, key=lambda x:x[1], reverse=True) for i in range(3): index = sorted_hw_list[i][0] print(chr(index + 65))