D=list(map(int,[input(),input(),input()])) A=lambda x:print('ABC'[D.index(sorted(D)[x])::3]) A(2) A(1) A(0)