ABC

Find the lexicographically smallest length-N string over A, B, C that has exactly K pairs i < j with S[i] < S[j].

Medium4GreedyCombinatoricsImplementationInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

Given integers NN and KK, write a program that finds a string SS meeting both of these conditions.

  • SS has length NN and uses only the characters A, B, and C.
  • Exactly KK pairs (i,j)(i, j) satisfy 0i<j<N0 \le i < j < N and S[i] < S[j].

Characters compare in alphabetical order, so A < B < C.

Input

The first line contains NN and KK, separated by a space. (3N303 \le N \le 30, 0KN(N1)/20 \le K \le N(N-1)/2)

Output

Print on the first line the lexicographically smallest string SS that meets the conditions. If no such SS exists, print -1.