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