import sys sys.setrecursionlimit(10**7) from functools import lru_cache @lru_cache(maxsize=None) def f(n): if n == 1: return 0 S = set() S.add(f(n//2)^f((n+1)//2)) if n >= 3: S.add(f(n//3)^f((n+1)//3)^f((n+2)//3)) now = 0 while True: if now not in S: return now now += 1 N = int(input()) print("A") if f(N) else print("B")