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