i,j,k;main(n){for(scanf("%d",&n);j%3||n--;k=++i)for(j=1;k&=k-1;j++);for(j=25,i=2*i-1;j;)(k=i>>--j)>1&&putchar(51+k%2*2);}