// #include // Temp fix for gcc13 global pragma // #pragma GCC target("avx2,bmi2,popcnt,lzcnt") // #pragma GCC optimize("O3,unroll-loops") #include // #include using namespace std; #if __cplusplus >= 202002L using namespace numbers; #endif #ifdef LOCAL #include "Debug.h" #else #define debug_endl() 42 #define debug(...) 42 #define debug2(...) 42 #define debug_bin(...) 42 #endif int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); int n, k; cin >> n >> k, -- k; vector a(n); a[n - 2] = 1, a[n - 1] = 2; while(k --){ while(true){ ++ a[n - 1]; for(auto i = n - 1; a[i] == 3; -- i){ if(i == 0){ cout << "-1\n"; return 0; } a[i] = 0; ++ a[i - 1]; } array flag{}; for(auto c: a){ flag[c] = true; } if(ranges::min(flag)){ break; } } } for(auto c: a){ cout << "ABC"[c]; } cout << "\n"; return 0; } /* */