n=int(input()) g=[0]*(n+1) def ni(x): if x%2:return x//2,x//2 + 1 else:return x//2,x//2 def san(x): t=x//3 if x%3 == 0: return t,t,t elif t*3 + 1 == x: return t,t,t+1 elif t*3 + 2 == x: return t,t+1,t+1 return False for i in range(2,n+1): s = set() nit = ni(i) t = 0 for j in nit: t^=g[j] s.add(t) t=0 sat = san(i) for j in sat: t^=g[j] s.add(t) p = 0 while p in s: p += 1 # print(p,i) g[i] = p print('A' if g[n] > 0 else 'B')