Problem: For the given integer () let's write down all the strings of length which contain letters 'a' and two letters 'b' in lexicographical (alphabetical) order.
Recall that the string of length is lexicographically less than string of length , if there exists such (), that , and for any () . The lexicographic comparison of strings is implemented by the operator < in modern programming languages.
For example, if the strings are (the order does matter):
- aaabb
- aabab
- aabba
- abaab
- ababa
- abbaa
- baaab
- baaba
- babaa
- bbaaa
It is easy to show that such a list of strings will contain exactly strings.
You are given () and (). Print the -th string from the list.
Input Format: The input contains one or more test cases.
The first line contains one integer () — the number of test cases in the test. Then test cases follow.
Each test case is written on the the separate line containing two integers and (.
The sum of values over all test cases in the test doesn't exceed .
Output Format: For each test case print the -th string from the list of all described above strings of length . Strings in the list are sorted lexicographically (alphabetically).