unsigned long a[32000],b[1600],t; p,s,x,y,z,i,j,m=64;main(n){ scanf("%d%d%d%d%d%*d",&n,&t,&x,&y,&z); for(;++i<=n;t=(t*x+y)%z)a[i/m]|=t%2<>p;p?b[i]|=a[j+1]<<64-p:0;} z=m-x%m;b[i-1]=b[i-1]<>z; p=y%64; for(i=0,j=y/m;i*64>64-p:0;} } for(i=0;++i<=n;)putchar(a[i/m]>>i%m&1?79:69); }