#include using namespace std; #define rep(i, n) for (int i=0; i<(int)n; i++) using ll = long long int; int main() { ll N; cin >> N; auto dfs = [&](auto dfs, ll x, string S) { if (x == N) { rep(i, (int)S.size()) cout << S[i]; cout << endl; return true; } if (x > N) return false; bool ret = false; ret = (dfs(dfs, x * 2 + 1, S + 'A')) || ret; ret = (dfs(dfs, x * 3 + 1, S + 'B')) || ret; return ret; }; dfs(dfs, 1, ""); return 0; }