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