#include using namespace std; int main() { int N, K, MMA = 6; cin >> N >> K; auto Check = [&](int M) { bitset<30> B(M); for (int i = 0; i < 28; i++) if (!B.test(i) && B.test(i + 1) && B.test(i + 2)) return true; return false; }; for (int i = 1; i < K; i++) { MMA++; while(!Check(MMA)) MMA++; } bitset<30> B(MMA); string Ans(N, 'A'); for (int i = N - 1; i >= 0; i--) Ans.at(N - i - 1) = B.test(i) ? 'M' : 'A'; cout << Ans << endl; }