All Submissions


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.

Input
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.

Output
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.

Constraints
1<=L<=100

Sample Input
3
1
2
3

Sample Output
A

ABB

Problem Setter: Dhruva Bhaswar

Languages: AWK,Bash,Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Python3,Ruby,Text

Time Limit: 3 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0