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