#include using namespace std; unsigned int m,seed,n=1e7+1,t,x,y,z,w,f=2145000000L,l=2149000000L; main() { cin>>seed; while(l-f>1) { m=((long)f+(long)l)/2; x=seed;y=1,z=2,w=3; int cnt=0; for(int i=0;i>19))^(t^(t>>8)); cnt+=w<=m; } if(cnt<5000001)f=m; else l=m; } cout<