import java.math.BigInteger; import java.util.*; public class Main { static int rec(int x){ if(grandy[x]!=-1) return grandy[x]; Set set = new HashSet<>(); set.add(rec(x/2)^rec((x+1)/2)); if(x>=3){ set.add(rec(x/3)^rec((x+1)/3)^rec((x+2)/3)); } int res=0; while(set.contains(res)) res++; return grandy[x]=res; } static int[] grandy; public static void main(String[] args) { Scanner sc=new Scanner(System.in); grandy = new int[101]; Arrays.fill(grandy, -1); grandy[1]=0; for(int i=1;i<101;i++) grandy[i]=rec(i); if(grandy[sc.nextInt()]==0){ System.out.println("B"); }else{ System.out.println("A"); } } }