#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const double PI = 3.14159265358979323846; const double EPS = 1e-12; const int INF = 1<<25; typedef pair P; typedef long long ll; typedef unsigned long long ull; #define N 2000000 int a[N]; ull A[N/64+100], B[N/64+100]; void bxor(ull *A, int a, ull *B, int b, int n){ int ma = a%64, mb = b%64; int aa = a/64, bb = b/64; for(int i = 0; i < (n+64); i++){ ull e = (B[bb+i]>>mb) | (B[bb+i])<<(64-mb); int ct = i+64-n; if(ct>0) e = (e<>ct; A[aa+i] ^= e<>(64-ma); } } int main(){ ll n, x, y, z; cin>>n>>a[0]>>x>>y>>z; for(int i = 1; i < n; i++) a[i] = (a[i-1]*x+y)%z; for(int i = 0; i < n; i++) A[i/64] |= (a[i]&1)<<(i%64); int q; cin>>q; for(int i = 0; i < q; i++){ for(int j = 0; j < n; j++) printf("%c",A[j/64]&(1<