import sys sys.setrecursionlimit(2*10**5) def input(): return sys.stdin.readline().rstrip('\n') def main(): n, k = map(int, input().split()) arr = [] mma = 0 def gen(): nonlocal arr, k, mma if len(arr) == n: if mma > 0: k -= 1 return ''.join(arr) if k == 0 else None mm = arr[-2:] == ['M', 'M'] arr.append('A') if mm: mma += 1 ans = gen() if ans is not None: return ans if mm: mma -= 1 arr.pop() arr.append('M') ans = gen() if ans is not None: return ans arr.pop() return None print(gen()) if __name__ == '__main__': main()