#include<iostream>
using namespace std;
bool g(int a)
{
bool b[10] = { false };
while (a != 0)
{
if (!b[a % 10])
{
b[a % 10] = true;
a = a / 10;
}
else return false;
}
return true;
}
int main()
{
int n; cin >> n;
while (n--)
{
int a; cin >> a;
if (g(a))
{
cout << "true" ;
}
else { cout <<"false " ; }
}
return 0;
}