A,B,C, = input(),input(),input() d ={"A":A,"B":B,"C":C} for k,v in sorted(d.items(),key=lambda x:x[1],reverse=True): print k