a = input D = {a():'A',a():'B',a():'C'} for k,v in sorted(D.items(),reverse=1): print(v)