ll n,i=1;{rd(n);for(;n-=__builtin_popcount(i+=2)%3==1;);(n=i>>-(-30..0))>1&&putchar(51+n%2*2);}