Lyndon's Words
In combinatorics, a Lyndon word of length n over an alphabet Σ is a string composed of n symbols from this alphabet, which is strictly smaller than all of its proper suffixes. Lyndon words are also referred to as primitive strings.
For instance, using the alphabet Σ = {a, b} with the usual order (a < b), there are six distinct Lyndon words of length n = 5: "aaaab", "aaabb", "aabab", "aabbb", "ababb", and "abbbb".
Given n and k, your task is to find the k-th lexicographical Lyndon word of length n over the alphabet Σ = {a, b}. The words are indexed starting from one.
Input
The first line of the input contains two integers n and k, separated by a space, representing the length and the ordinal number of the Lyndon word, respectively (1 ≤ n ≤ 25). It is guaranteed that a word of length n with the specified number k exists.
Output
Output the required Lyndon word on the first line.