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