#include<bits/stdc++.h>
using namespace std;
vector<string>v;
bool run(string& a){
    long long br=0;
    for (long long i=0;i<a.size();i++){
        for (long long j=0;j<a.size();j++){
            if (j==i) continue;
            if (a[i]==a[j]) br++;
        }
        if (br%2!=0){
            return false;
        }
        br=0;
    }
    return true;
}
int main (){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long n;
    cin >> n;
    string a;
    for (long long i=0;i<n;i++){
        cin >> a;
        v.push_back(a);
    }
    for (long long i=0;i<n;i++){
        cout << run(v[i]);
    }
    return 0;
}

