#include <iostream>
#include <cstring>
using namespace std;

int main ()
{
    int n, br = 0, flag = 0, ch = 0;
    cin >> n;
    char niz[8000], niz1[n];
    int len, symbol;
    for (int i = 1; i <= n; i++)
    {
        cin >> niz;
        len = strlen(niz);
        if (len % 2 == 0)
        {
            for (int j = 0; j < len; j++)
            {
                for (int u = niz[j]+1; u < len; u++)
                {
                    if ((niz[j] == niz[u]) && (ch != niz[j]))
                    {
                        br++;
                    }
                }
                if ((br != 0) && ((br + 1) % 2 != 0))
                {
                    niz1[n] = {0};
                    j = len;
                }
                br = 0;
                ch = niz[j];
                flag++;
            }
            if (flag == len)
            {
                niz1[n] = {1};
            }
        }
        else
        {
            for (int j = 0; j < len; j++)
            {
                for (int u = niz[j]+1; u < len; u++)
                {
                    if ((niz[j] == niz[u]) && (ch != niz[j]) && (j != len / 2))
                    {
                        br++;
                    }
                }
                if ((br != 0) && ((br + 1) % 2 != 0))
                {
                    niz1[n] = {0};
                    j = len;
                }
                br = 0;
                ch = niz[j];
                flag++;
            }
            if (flag == len)
            {
                niz1[n] = {1};
            }
        }
    }
    cout << niz1 << endl;
    return 0;
}

