n = int(input()) g = [0]*(n+1) for i in range(2,n+1): s = set() s.add(g[i//2]^g[i-i//2]) s.add(g[i//3]^g[(i+1)//3]^g[(i+2)//3]) for j in range(n+1): if j not in s: g[i] = j break print("A" if g[n] else "B")