N=int(raw_input()) dp=[0 for i in range(101)] dp[1]=0 dp[2]=1 for i in range(3,N+1): half=dp[i/2]^dp[i-i/2] tri=dp[i/3]^dp[(i-i/3)/2]^dp[i-i/3-(i-i/3)/2] for j in range(3): if j!= half and j!= tri: dp[i]=j break #print i,half,tri,i/3,(i-i/3)/2,i-(i-i/3)/2,dp[i] if dp[N] == 0: print "B" else: print "A"