#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 = 0; i < min(30, N); i++) Ans.at(i) = B.test(i) ? 'M' : 'A'; reverse(Ans.begin(), Ans.end()); cout << Ans << endl; }