#include using namespace std; #include using namespace atcoder; using mint = atcoder::modint998244353; // using mint = double; #define rep(i, l, r) for (int i = (int)(l); i<(int)(r); i++) #define ll long long #define ld long double #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define siz(x) (int)(x).size() template bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } const int inf = 1e9; const ll INF = 4e18; template using pq = priority_queue, less>; template using spq = priority_queue, greater>; vector di = {0, 0, 1, -1}; vector dj = {1, -1, 0, 0}; struct Edge { int to, cost; }; void solve() { int N, K; cin >> N >> K; K--; int M = min(N, 22); vector ans; rep(S, 0, 1<>i)&7; if (x == 6) ok = true; } if (ok) ans.push_back(S); } int t = ans[K]; string S(N, 'A'); rep(i, 0, M) { if (t>>i&1) S[N - i - 1] = 'M'; } cout << S << endl; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int T = 1; // cin >> T; while(T--) { solve(); } }