A, B, C = map(int, open(0)) L = sorted([A, B, C], reverse=True) for x in [A, B, C]: print("ABC"[L.index(x)])