#include <iostream>
#define int long long
using namespace std;
constexpr int mod1(998244353);
constexpr int mod2(1000000007);
constexpr int mod3(917120411);
constexpr int MAXN(3000007);
string s;
int a[MAXN], hs1[MAXN], hs2[MAXN], d1[MAXN], d2[MAXN], ans[MAXN];
int n, misaki(1)
inline void read(int &temp) { cin >> temp; }
inline int val(int x) {
if (x <= '9' && x >= '0') return x - '0';
if (x >= 'a' && x <= 'z') return x - 'a' + 10;
return x - 'A' + 36;
}
inline int calc(string s) {
int res(0);
for (int i(0); i < (int)s.length(); ++i) res = res * 62ll + val(s[i]);
return res;
}
inline int hsh(int l, int r, int *a, int *b, int c)
{ return (a[r] - a[l - 1] * b[r - l + 1] % c + c) % c; }
inline bool check(int x, int k, int *a, int *b, int c)
{ return (hsh(1, x - 2 * k, a, b, c) + hsh(1 + 2 * k, x, a, b, c)) % c == hsh(1 + k, x - k, a, b, c) * 2 % c; }
signed main() {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
read(n), d1[0] = d2[0] = 1;
for (int i(1); i <= n; ++i) cin >> s, a[i] = calc(s);
// cout << endl;
for (int i(1); i <= n; ++i) hs1[i] = (hs1[i - 1] * mod3 + a[i]) % mod1, d1[i] = d1[i - 1] * mod3 % mod1;
for (int i(1); i <= n; ++i) hs2[i] = (hs2[i - 1] * mod3 + a[i]) % mod2, d2[i] = d2[i - 1] * mod3 % mod2;
for (int k(1); k <= n; ++k) {
while (misaki <= n && misaki <= 2 * k) ++misaki;
if (misaki > n) break;
while (misaki <= n && check(misaki, k, hs1, d1, mod1) && check(misaki, k, hs2, d2, mod2)) ans[misaki] = 1, ++misaki;
if (misaki > n) break;
}
for (int i(1); i <= n; ++i) cout << ans[i];
cout << endl;
return 0;
}
/*
9
1C 3f 4S 3h 88 6x 4W d1 8c
*/