#include #include #define rep(i,n) for(int i = 0; i < n; i++) #define rrep(i,a,b) for(int i = a; i < b; i++) #define all(A) (A).begin(),(A).end() #define MOD 1000000007 #define grt greater() #define mapf(M) for(auto& [k,v] : M) using namespace std; using ll = long long; using P = pair; using pq = priority_queue,greater>; ll INF = 1LL<<60; template bool chmax(T &a,T &b){ if(a < b){ a = b; return true; } return false; } template bool chmin(T &a,T &b){ if(a > b){ a = b; return true; } return false; } struct Edge { int to; int cost; int from; }; using Graph = vector>; using vi = vector; void dfs(string s,string& ans,int x,int n){ if(n == x) return; if(x*2+1 <= n){ s.push_back('A'); dfs(s,ans,x*2+1,n); if(x*2+1 == n) ans = s; s.pop_back(); } if(x*3+1 <= n){ s.push_back('B'); dfs(s,ans,x*3+1,n); if(x*3+1 == n) ans = s; s.pop_back(); } return; } int main(void){ int n; cin >> n; string ans = "",s = ""; int x = 1; dfs(s,ans,x,n); cout << ans; }