Little Elephant and Strings
Little Elephant from the zoo of Lviv loves strings. He recently found a new kind of strings and called them hilarious strings. The hilarious strings have the property that the frequency of each character is equal to the position of the first occurence of that character in the string, position to be considered in 1-based indexing. So, the string "EDFDFF" is a hilarious string as the first occurence of E is at position 1 and E also has frequency 1 in the string. Similarly, D occurs at position 2 for the first time and also has the frequency of 2. So does F.
Little Elephant analysed the hilarious strings and in his research became particularly interested in the lexicographically smallest hilarious string of particular length. He needs your help in finding such hilarious strings.
There are T test cases. First line give this value T. T lines follow. Each line gives you the length of the hilarious string. All hilarious strings will only contain upper case english characters from A-Z.
For each test case there will be one line output giving the lexicographically smallest hilarious string of the given length L. If no such string is possible for some length, then simply print an empty line.
Problem Setter: Dhruva Bhaswar