#include<bits/stdc++.h>
using namespace std;
const int maxn=2e6+5;
const ll mod=2000298369ll*31;
inline int read() {
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
while(ch>='0'&&ch<='9') {x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
return x*f;
}
int n,a[maxn];
typedef long long ll;
ll qp[maxn],sum[maxn];
ll query(int l,int r) {
ll tmp=sum[r]-sum[l-1]*qp[r-l+1]%mod;
if(tmp<0) tmp+=mod;
return tmp;
}
int Min[maxn];
bool check(int x,int y,int k,int len) {
ll tmp1=query(y,y+len-1)-query(y-k,y-k+len-1);
if(tmp1<0) tmp1+=mod;
ll tmp2=query(x,x+len-1)-query(1,len);
if(tmp2<0) tmp2+=mod;
if(tmp1==tmp2) return 1;
return 0;
}
inline int get_num(char c){
if(c>='0'&&c<='9')return c-48;
if(c>='a'&&c<='z')return c-'a'+10;
if(c>='A'&&c<='Z')return c-'A'+36;
return -1;
}
inline int readc() {
int x=0,f=1;
char ch=getchar();
while(get_num(ch)==-1) {if(ch=='-') f=-1;ch=getchar();}
while(get_num(ch)!=-1) {x=x*62+get_num(ch);ch=getchar();}
return x*f;
}
int main() {
n=read();
qp[0]=1;
for(int i=1;i<=n;++i) {
a[i]=readc();
qp[i]=qp[i-1]*233ull;
qp[i]%=mod;
sum[i]=sum[i-1]*233ull+a[i];
sum[i]%=mod;
Min[i]=i;
}
for(int k=1;k<=(n-1)/2;++k) {
ll now=query(k+1,k*2)-query(1,k);
if(now<0) now+=mod;
int p=2;
for(int len=3;len*k<=n;++len) {
ll tmp=query((len-1)*k+1,len*k)-query((len-2)*k+1,(len-1)*k);
if(tmp<0) tmp+=mod;
if(tmp!=now) break;
p=len;
}
int l=p*k+1,r=min((p+1)*k,n);
while(l<=r) {
int mid=l+r>>1;
if(check(k+1,p*k+1,k,mid-p*k)) l=mid+1;
else r=mid-1;
}
if((r-1)/2>=k) Min[r]=min(Min[r],k);
}
for(int i=n-1;i;--i) Min[i]=min(Min[i+1],Min[i]);
for(int i=1;i<=n;++i) {
if(Min[i]<=(i-1)/2) putchar('1');
else putchar('0');
}
return 0;
}