Inversion : Assume we have a string containing only the letters ‘A’ and ‘B’, e.g., AAABABAA. We define an inversion to be a pair of letters in the string where one letter is B, the other letter is A, and the position of B in the string is earlier than the position of A in the string. For our sample string, the B at position 4 and the A at position 5 form an inversion. Similarly, the B at position 4 and the A at position 7 form an inversion. There is a total of five inversions in the sample string
There is only one input line; it consists of two integers: n (1 ≤ n ≤ 60), representing the length of each string in the list Michio has, and k, representing the number of inversions per string. It is guaranteed that k will be selected such that at least one string containing A’s and B’s of length n will have exactly k inversions. (Note that the bounds for k are implied by the other constraints in the problem, i.e., the bounds for k need not be provided.)
If the number of unique strings of A’s and B’s of length n with k inversions is odd, print a single line with the median string. If the number of unique strings of A’s and B’s of length n with kinversions is even, then print two lines each containing one of the median strings (these two strings should be printed in lexicographical order).