Yesterday while Omar was trying to learn English, he saw that there are letters repeated many times in words while some other letters repeated only few times or not repeated at all!  

Of course anyone can memorize the letters (repeated many times) better than the letters repeated few times, so Omar will concatenate all the words in the context he has, and try to know the difficulty of each letter according to the number of repetitions of each letter.  

So Omar has now the whole context and wants to arrange the letters from the most difficult letter (repeated few times) to the less difficult letter (repeated many times).  

If there are 2 letters with the same level of difficulty, the letter with higher value of ASCII code will be more difficult.  

Input Format:
Given an integer (T), 1 ≤ T ≤ 10 (number of test cases).
For each test case:
Given a string of (lower English characters), 1 ≤ size\; of\; string ≤ 10 ^ 6.
(each string in a new line).  

Output Format:
Output the English lower case characters from the most difficult letter to the less difficult letter. (leave a space between 2 successive letters)
(Output each test case in a separate line).

SAMPLE INPUT
1
oomar

SAMPLE OUTPUT
z y x w v u t s q p n l k j i h g f e d c b r m a o
def difficult_letters(context):
    freq = {}
    for c in context:
        if freq.has_key(c):
            freq[c] += 1
        else:
            freq[c] = 1
    for c in 'abcdefghijklmnopqrstuvwxyz':
        if not freq.has_key(c):
            freq[c] = 0
    freq2 = {}
    for k,v in freq.items():
        if freq2.has_key(v):
            freq2[v] += [k]
        else:
            freq2[v] = [k]
    freq_sorted = sorted(freq2.keys())
    s = ''
    for k in freq_sorted:
        arr = sorted(freq2[k])[::-1]
        s += ' '.join(str(e) for e in arr) + ' '
    return s



def main():
    T = int(raw_input().strip())
    for t in range(T):
        context = raw_input().strip()
        ans = difficult_letters(context)
        print ans

if __name__ == '__main__':
    main()