Special numbers

2

3 votes
Basic Programming, Bit Manipulation, Bit manipulation, Easy, Logic-Based, String Manipulation
Problem

Alice is traveling to a special town with her friends. All the residents of this special town communicate through a special language. This special language consists of 4 special alphabets a,b,c and d. This language contains special words. These words are composed of these 4 special alphabets and are always even in length. The words are always palindromic in nature. The words are also assigned special numbers. A special number is the lexicographical rank of special word with respect to other special words. 

You are given a special number. Your task is to determine the special word corresponding to that special number. 

Note: A palindrome sequence that reads the same backward as forwards. For example, aaaaabba, and so on.

Input format

  • First line: A single integer T denoting the number of test cases
  • For each test case: 
    • First line: A single integer k denoting the special number

Output format

For each test case, print a string that denotes the special number corresponding to the special number in a new line.

Constraints

1T105

1k109

 

Sample Input
3
1
4
6
Sample Output
aa
dd
abba
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

The first 6 special words are aa,bb,cc,dd,aaaa,abba.

Editor Image

?