#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
unsigned long long n,k,m;
string s;
int main()
{
freopen("aa.in","r",stdin);
freopen("aa.out","w",stdout);
scanf("%ull%ull",&n,&k);
m=n;k++;
while(m>=1){
if(k%4==0)s[m]='0';
if(k%4==1)s[m]='0';
if(k%4==2)s[m]='1';
if(k%4==3)s[m]='1';
if((k&1)&&(k!=1))k=(k>>1)+1;
else k>>=1;
m--;
}
for(int i=1;i<=n;i++)
cout<<s[i];
}