N = int(input()) S = int(input()) from collections import deque ans = [] q = deque(["C", "B", "A"]) while q: s = q.pop() if len(s) == N: if s.count("A") != 0 and s.count("B") != 0 and s.count("C") != 0: ans.append(s) else: q.append(s + "C") q.append(s + "B") q.append(s + "A") if S-1 < len(ans): print(ans[S-1]) else: print(-1)