package no153; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { int[] grundy = new int[101]; for(int i=2;i<=100;i++) { PriorityQueue s = new PriorityQueue<>(); s.add(grundy[i/2] ^ grundy[(i+1)/2]); if (i >= 3) { s.add(grundy[i/3] ^ grundy[(i+1)/3] ^ grundy[(i+2)/3]); } s.add(999); for(int j=0;j<3;j++) { if (s.poll() != j) { grundy[i] = j; break; } } } // System.out.println(Arrays.toString(grundy)); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); System.out.println(grundy[n] == 0 ? "B" : "A"); } }