AB String

Find the length-N A/B string whose number of (A before B) pairs equals K, choosing the lexicographically smallest such string.

Medium4GreedyCombinatoricsStringInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

You are given two integers NN and KK. Find a string SS that satisfies both conditions below.

  • SS has length NN and uses only the letters 'A' and 'B'.
  • Exactly KK pairs (i,j)(i, j) satisfy 0i<j<N0 \le i < j < N, character ii of SS is 'A', and character jj of SS is 'B'. Positions are counted from 0.

If more than one string satisfies both conditions, find the lexicographically smallest one. In lexicographic order 'A' comes before 'B'.

Input

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

Output

Print the lexicographically smallest string SS that satisfies the conditions. If no such SS exists, print -1.