import java.util.*; public class Main_yukicoder153_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] grundy = new int[n + 1]; for (int i = 2; i <= n; i++) { Set st = new HashSet<>(); int g; if (i % 2 == 0) { g = grundy[i / 2] ^ grundy[i / 2]; } else { g = grundy[i / 2] ^ grundy[i / 2 + 1]; } st.add(g); if (i % 3 == 0) { g = grundy[i / 3] ^ grundy[i / 3] ^ grundy[i / 3]; } else if (i % 3 == 1) { g = grundy[i / 3] ^ grundy[i / 3] ^ grundy[i / 3 + 1]; } else { g = grundy[i / 3] ^ grundy[i / 3 + 1] ^ grundy[i / 3 + 1]; } st.add(g); for (int j = 0; true; j++) { if (!st.contains(j)) { grundy[i] = j; break; } } } if (grundy[n] > 0) { System.out.println("A"); } else { System.out.println("B"); } sc.close(); } }