import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string; auto rdsp(){return readln.splitter;} void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;} void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);} void main() { int n; readV(n); auto g = new int[](n+1); foreach (i; 2..n+1) { auto mex = new bool[](n+1); foreach (a; 1..i) { auto b = i-a; mex[g[a]^g[a]] = true; } foreach (a; 1..i-1) foreach (b; 1..i-1) { auto c = i-a-b; if (c <= 0) break; mex[g[a]^g[b]^g[c]] = true; } g[i] = mex.countUntil(false).to!int; } writeln(g[n] == 0 ? "B" : "A"); }