Sheldon has come up with a new language in which all words are made up of exactly K Lowercase english Letters .
For example if K=4, then :
Now consider a K-dictionary that contains all the words of this new language in asscending order. For example if K=3, the dictionary contains words "aaa", "aab", "aac" ... "aaz", "aba", "abb" ... "abz", "aca" and so on.
Sheldon wants to translate "The roommate agreement" into this new language. The translation is done word by word as follows :
Clearly the above translation is a complex process and can't be done manually. So Sheldon asked his friend Howard for help. But as Sheldon always makes fun of him, Howard refused. So now you have to help Sheldon.
More formally you will be given two integers K and P, You have to find the word with position P in the K-dictionary. You have to do this for T test cases.
Input :
Output :
For every test case print the word with position P in K-dictionary. If P exceeds the size of the K-dictionary, print −1.
Answer of every test case should start in a seperate line.
Constraints :
Subtasks :
10 points :
90 points :
For K=4, dictionary contains words in order : "aaaa", "aaab", "aaac", "aaad", "aaae" .. and so on. The word at 4th position is "aaad". So output for K=4,P=4 is "aaad"
For K=1, there are only 26 words "a", "b", ... "z" in the dictionary. So output for K=1,P=30 is −1