Find the lexicographically smallest length-N string over A, B, C that has exactly K pairs i < j with S[i] < S[j].
Given integers NNN and KKK, write a program that finds a string SSS meeting both of these conditions.
A
B
C
S[i] < S[j]
Characters compare in alphabetical order, so A < B < C.
The first line contains NNN and KKK, separated by a space. (3≤N≤303 \le N \le 303≤N≤30, 0≤K≤N(N−1)/20 \le K \le N(N-1)/20≤K≤N(N−1)/2)
Print on the first line the lexicographically smallest string SSS that meets the conditions. If no such SSS exists, print -1.
-1