Chef likes to play with big numbers. Today, he has a big positive integer N. He can select any two digits from this number (the digits can be same but their positions should be different) and orders them in any one of the two possible ways. For each of these ways, he creates a two digit number from it (might contain leading zeros). Then, he will pick a character corresponding to the ASCII value equal to this number, i.e. the number 65 corresponds to 'A', 66 to 'B' and so on till 90 for 'Z'. Chef is only interested in finding which of the characters in the range 'A' to 'Z' can possibly be picked this way. 

-----Input-----
The first line of the input contains an integer T denoting the number of test cases.
The first line of the input contains an integer N. 

-----Output-----
For each test case, output a string containing characters Chef can pick in sorted order If the resulting size of string is zero, you should output a new line.

-----Constraints-----
- 1 ≤ T ≤ 10
- 1 ≤ N ≤ 10100000

-----Subtasks-----
- Subtask #1 (40 points) N ≤ 1010
- Subtask #2 (60 points) Original Constraints

-----Example-----
Input:
4
65
566
11
1623455078

Output:
A
AB

ACDFGHIJKLNPQRSTUVW

-----Explanation-----
Example case 1. Chef can pick digits 6 and 5 and create integers 56 and 65. The integer 65 corresponds to 'A'.
Example case 2. Chef can pick digits 6 and 5 and create 'A' as it equals 65. He can pick 6 and 6 (they are picked from position 2 and position 3, respectively) to create 'B' too. Hence answer is "AB".
Example case 3. It's not possible to create any character from 'A' to 'Z'. Hence, we just print a new line.

Difficulty: interview

Starter code:

Solutions:
test=int(input())
for i in range(test):
 N=input()
 X=[]
 list2=[]
 for x in N:
  X.append(x)
 list1=[]
 list1=list(set(X))
 output=''
 for x in list1:
  for y in X:
   if int(x)>=6:
    n=int(x)*10+int(y)
    list2.append(n)
 for j in list1:
  if int(j)>=6:
   m=int(j)*10+int(j)
   list2.remove(m)
 list2.sort()
 if len(list2)==0:
  print(" ")
 else:
  list2.sort()
  for k in list2:
   if chr(k) not in output and 64<k<91:
    output+=chr(k)
  print(output)
 


test=int(input())
for i in range(test):
 N=input()
 X=[]
 for x in N:
  X.append(x)
 Y=[]
 list1=[]
 output=''
 for y in X:
  if int(y)>=6 and int(y) not in Y:
   Y.append(y)
 for x in Y:
  for y in X:
   if int(x)==6:
    if int(y)>=5:
     n=int(x)*10+int(y)
     list1.append(n)
   elif int(x)==9:
    if int(y)==0:
     n=int(x)*10+int(y)
     list1.append(n) 
   else:
    n=int(x)*10+int(y)
    list1.append(n)
 for j in Y:
  if int(j)!=9:
   m=int(j)*10+int(j)
   list1.remove(m)
   
 list1.sort()
 if len(list1)==0:
  print(" ")
 else:
  list1.sort()
  for k in list1:
   if chr(k) not in output:
    output+=chr(k)
  print(output)

test=int(input())
for i in range(test):
 N=input()
 X=[]
 for x in N:
  X.append(x)
 Y=[]
 list1=[]
 output=''
 for y in X:
  if int(y)>=6 and int(y) not in Y:
   Y.append(y)
 for x in Y:
  for y in X:
   if int(x)==6:
    if int(y)>=5:
     n=int(x)*10+int(y)
     list1.append(n) 
   else:
    n=int(x)*10+int(y)
    list1.append(n)
 for j in Y:
  m=int(j)*10+int(j)
  list1.remove(m)
 list1.sort()
 if len(list1)==0:
  print(" ")
 else:
  list1.sort()
  for k in list1:
   if chr(k) not in output and k<91:
    output+=chr(k)
  print(output)

test=int(input())
for i in range(test):
 N=input()
 X=[]
 for x in N:
  X.append(x)
 Y=[]
 list1=[]
 output=''
 for y in X:
  if int(y)>=6 and int(y) not in Y:
   Y.append(y)
 for x in Y:
  for y in X:
   if int(x)==6:
    if int(y)>=5:
     n=int(x)*10+int(y)
     list1.append(n) 
   else:
    n=int(x)*10+int(y)
    list1.append(n)
 for j in Y:
  m=int(j)*10+int(j)
  list1.remove(m)
 list1.sort()
 if len(list1)==0:
  print(" ")
 else:
  list1.sort()
  for k in list1:
   if chr(k) not in output and k<91:
    output+=chr(k)
  print(output)
   
   
   


for t in range(int(input())):
 word=input()
 lis=list(word)
 d={}
 for l in range(10):
  d[l]=None
 s=''
 for w in lis:
  if d[int(w)]!=None:
   d[int(w)]+=1
  else:
   d[int(w)]=1
 
 for i in range(5,10):
  if d[i]!=None and i!=6 and d[6]!=None:
   s=s+chr(60+i)
  if d[i]!=None and d[i]>=2 and i==6:
   s=s+chr(60+i)
 for i in range(10):
  if d[i]!=None and i!=7 and d[7]!=None:
   s=s+chr(70+i)
  if d[i]!=None and d[i]>=2 and i==7:
   s=s+chr(70+i)
 for i in range(10):
  if d[i]!=None and i!=8 and d[8]!=None:
   s=s+chr(80+i)
  if d[i]!=None and d[i]>=2 and i==8:
   s=s+chr(80+i)
 if d[9]!=None and d[0]!=None:
  s=s+chr(90)
 if len(s)==0:
  print()
 else:
  print(s)
   
  


import numpy as np
for t in range(int(input())):
 n = list(input())
 arr = [int(x) for x in n]
 num = []
 if 6 in arr:
  for i in arr:
   if i>=5:
    num.append(6*10 + i)
 if 66 in num:
  num.remove(66)
 if 7 in arr:
  for i in arr:
   num.append(7*10 + i)
 if 77 in num:
  num.remove(77)
 if 8 in arr:
  for i in arr:
   num.append(8*10 + i)
 if 88 in num:
  num.remove(88)
 if 9 in arr:
  if 0 in arr:
   num.append(90)
 num = np.array(num)
 np.sort(num)
 ch = ''
 for i in np.unique(num):
  ch += chr(i)
 
 print(ch)


t = int(input())
for p in range(t):
 n = str(input())
 l = len(n)
 cnt = [0] * 10
 for i in range(l):
  if (cnt[int(n[i])] < 2):
   cnt[int(n[i])] += 1
 output = []
 if (cnt[6] > 0):
  for j in range(5, 10):
   if (cnt[j] > 0 and j != 6):
    output.append(chr(6 * 10 + j))
   elif (j == 6 and cnt[j] > 1):
    output.append(chr(66))
 if (cnt[7] > 0):
  for j in range(0, 10):
   if (cnt[j] > 0 and j != 7):
    output.append(chr(7 * 10 + j))
   elif (j == 7 and cnt[j] > 1):
    output.append(chr(77))
 if (cnt[8] > 0):
  for j in range(0, 10):
   if (cnt[j] > 0 and j != 8):
    output.append(chr(8 * 10 + j))
   elif (j == 8 and cnt[j] > 1):
    output.append(chr(88))

 if (cnt[9] > 0):
  if (cnt[0] > 0):
   output.append(chr(90))
 ops = ''.join(output)
 if (len(ops) != 0):
  print(ops)
 else:
  print()

from itertools import permutations
for j in range(int(input())):
 n=input()
 c=""
 x=list(permutations(n,2))
 a=set(x)
 for i in a:
  z=i[0]+i[1]
  if(int(z)>=65 and int(z)<=90):
   c+=chr(int(z))
 if(c==""):
  print("")
 else:
  am=list(c)
  am.sort()
  bm="".join(am)
  print(bm)


from itertools import permutations
from collections import Counter
for _ in range(int(input())):
 a=list(input())
 a=map(int,a)
 z=dict(Counter(a))
 l=list(z.keys())
 for i in sorted(z.keys()):
  j=z[i]
  if i>5:
   if j >1:
    for k in sorted(l):
     if i*10+k<91 and i*10+k>64:
      print(chr(i*10+k),end="")
   else:
    l.remove(i)
    for k in sorted(l):
     if i*10+k<91 and i*10+k>64 :
      print(chr(i*10+k),end="")
    l.append(i)
 print()

# cook your dish here
from itertools import permutations
for _ in range(int(input())):
 a=list(input())
 for i in sorted(set(permutations(a,2))):
  c=int(i[0])*10+int(i[1])
  if c>=65 and c<91:
   print(chr(c),end="")
 print("")

from collections import Counter 
for i in range(int(input())):
 a = [int(i) for i in str(input())];a1 = [];asdf = Counter(a)
 for n in range(65, 91):
  nn = n%10;nn1 = n//10
  if nn == nn1:
   if asdf[nn] >= 2:a1.append(chr(n))
  else:
   if asdf[nn]>0 and asdf[nn1]> 0:a1.append(chr(n))
 print() if len(a1) == 0 else print(''.join(a1)) 

from collections import Counter 

for i in range(int(input())):
 a = [int(i) for i in str(input())]
 a1 = []
 # print(a, Counter(a), Counter(a)[6])
 asdf = Counter(a)
 for n in range(65, 91):
  nn = n%10
  nn1 = n//10
  # print(nn, nn1, asdf[nn], asdf[nn1])
  if nn == nn1:
   if asdf[nn] >= 2:
    a1.append(chr(n))
  else:
   if asdf[nn]>0 and asdf[nn1]> 0:
    a1.append(chr(n))
 if len(a1) == 0:
  print()
 else:
  
  print(''.join(a1))

t=int(input())
from itertools import permutations
for i in range(t):
 n=int(input())
 s=list(str(n))
 l=[]
 perm=permutations(s,2)
 perm=set(list(perm))
 #print(list(perm))
 for i in list(perm):
  #print(i)
  s=""
  s+=str(i[0])
  s+=str(i[1])
  s=int(s)
  if(s>=65 and s<=90):
   l.append(chr(s))
 l.sort()
 for i in l:
  print(i,end="")
   
 print()
  
 

# cook your dish here
for _ in range(int(input())):
 s = input()
 a = [0 for x in range(10)]
 for i in s:
  a[ord(i)-ord('0')] += 1
 ans =""
 
 if a[6]!=0:
  i = 6
  a[i] -=1
  for j in range(5,10):
   if a[j]!=0:
    ans += chr(60 + j)
  a[i] +=1
 
 for i in range(7,9):
  if a[i]!=0:
   a[i]-=1
   for j in range(10):
    if a[j]!=0:
     ans += chr(i*10 + j)
   a[i] += 1
 
 if a[9]!=0 and a[0]!=0:
  ans+='Z'
 print(ans)
   


# cook your dish here
from collections import Counter
t=int(input())
for i in range(t):
 s=input()
 c=Counter(s)
 l=[]
 for item in list(c.keys()):
  if(c[item]>=2):
   l.append(item)
   l.append(item)
  else:
   l.append(item)
 l=[int(k) for k in l]
 ans=""
 
 for j in range(len(l)):
  for k in range(j+1,len(l)):
   a=10*l[j]+l[k]
   b=10*l[k]+l[j]
   if(a>=65 and a<=90):
    ans+=str(chr(a))
   if(b>=65 and b<=90):
    ans+=str(chr(b))
 c=Counter(ans)
 l=list(c.keys())
 l.sort()
 ans=''
 for item in l:
  ans+=item
 print(ans)

# cook your dish here
for i in range(int(input())):
 
 s=input()
 z=s
 h=""
 l=[]
 k=0
 while(len(z)!=0):
  if(k>=len(z)):
   break
  if(int(z[k])<6):
   f=z[k]
   z=z.replace(f, '')
   h=h+f
  else:
   
   f=z[k]
   h=h+f
   k+=1
   
   
   
 for i in range(len(h)):
  
  a=int(h[i])
  
  if(a>=6):
   
   for j in range(len(h)):
    b=int(h[j])
    if(a==6) and (b<5):
     continue
    if(j!=i):
     
     
     
     n=(a*10)+b
     
     if(n>=65) and (n<=90):
      
      l.append(chr(n))
      
     
 l=set(l)
 l=list(l)
 l.sort()
 print("".join(l))


# cook your dish here
for i in range(int(input())):
 
 s=input()
 l=[]
 for i in range(len(s)):
  
  a=int(s[i])
  
  if(a>=6):
   
   for j in range(len(s)):
    b=int(s[j])
    if(a==6) and (b<5):
     continue
    if(j!=i):
     
     
     
     n=(a*10)+b
     
     if(n>=65) and (n<=90):
      
      l.append(chr(n))
      
     
 l=set(l)
 l=list(l)
 l.sort()
 print("".join(l))