/* -*- coding: utf-8 -*- * * 153.cc: No.153 石の山 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100; /* typedef */ typedef vector vi; /* global variables */ int gndys[MAX_N + 1]; bool used[MAX_N + 1]; /* subroutines */ /* main */ int main() { int n; cin >> n; gndys[0] = gndys[1] = 0; for (int i = 2; i <= n; i++) { memset(used, false, sizeof(used)); used[gndys[i / 2] ^ gndys[(i + 1) / 2]] = true; if (i >= 3) used[gndys[i / 3] ^ gndys[(i + 1) / 3] ^ gndys[(i + 2) / 3]] = true; for (gndys[i] = 0; used[gndys[i]]; gndys[i]++); } printf("%c\n", (gndys[n] != 0) ? 'A' : 'B'); return 0; }