#include using namespace std; int main() { int N, S; cin >> N >> S; vector> ans; vector A(N); auto dfs = [&] (auto dfs, int now) -> void { if (now == N) { bool ok = true; for (int i = 0; i <= 2; i++) { ok &= find(A.begin(), A.end(), i) != A.end(); } if (ok) ans.push_back(A); } else { for (int i = 0; i <= 2; i++) { A[now] = i; dfs(dfs, now + 1); } } }; dfs(dfs, 0); S--; if (S < ans.size()) { for (int i: ans[S]) cout << (char)('A' + i); cout << endl; } else { cout << -1 << endl; } return 0; }