#include using namespace std; string adjust_taste(int N) { string steps = ""; while (N != 1) { if (N % 2 == 0) { N /= 2; steps += 'A'; } else { N = (N - 1) / 2; steps += 'B'; } } reverse(steps.begin(), steps.end()); return steps; } int main() { int N; cin >> N; string steps = adjust_taste(N); cout << steps << endl; return 0; }