import sys n=int(raw_input()) if n==1: print 'B' sys.exit() g=[0 for i in xrange(n+1)] g[2]=1 for i in xrange(3,n+1): s=[] if i%2==0: s.append(0) if i%2==1: s.append(g[i/2]^g[i/2+1]) if i%3==0: s.append(g[i/3]) if i%3==1: s.append(g[i/3+1]) if i%3==2: s.append(g[i/3]) while s.count(g[i]): g[i]+=1 if g[n]==0: print 'B' else: print 'A'