#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;while(t--)
{
string s;
cin>>s;int a,b,i,f,m,l,len;
char c;for(c='A';c<='Z';c++)
{a=0;
b=0;int f = c / 10;
int l = c % 10;
len=s.length();if(f!=l)
{for(i=0;s[i]!='\0';i++)
{
if(int(s[i])==f)
a++;if(s[i]==l)
b++;}
if(a>=1&&b>=1)
cout<<c<<endl;
}else if(f==l)
{
a=0;
for(i=0;i<len;i++)
{if(s[i]==f)
a++;
}
}if(a>=2)
cout<<c<<endl;}
}
return 0;
}
Asked by: Manish_Kumar_Savita on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.