#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) int main() { int n; cin >> n; int s; cin >> s; vector a(3, 0); a[0] = n; vector t(n, 0); int in = 0; int on = 0; int p = 1; rep(i, n) { on += p * 2; p *= 3; } rep(i, s) { bool zero = true; int c = 0; while (zero) { in++; c = 1; rep(j, n) { a[t[j]]--; t[j] += c; c = t[j] / 3; t[j] %= 3; a[t[j]]++; } zero = false; rep(j, 3) if (a[j] == 0) zero = true; } } if (in > on) { cout << -1 << endl; } else { rep(i, n) cout << (char)('A' + t[(n-1) - i]); cout << endl; } return 0; }