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