ha = int(input()) hb = int(input()) hc = int(input()) H = [ha, hb, hc] mx = max(H) mn = min(h) if mx==ha: mx_c = 'A' elif mx==hb: mx_c = 'B' else: mx_c = 'C' if mn==ha: mn_x = 'A' elif mn==hb: mn_c = 'B' else: mn_c = 'C' print(mx_c) if mx_c!='A' and mn_c!='A': print('A') elif mx_c!='B' and mn_c!='B': print('B') else: print('C') print(mn_c)