#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; int S,X,Y,Z; cin >> S >> X >> Y >> Z; vector B(N); for(int i=0; i A(n),A2(n); int pos = 0,bit = 0; for(int i=0; i::max(); auto move = [&](int l,int r,int L,int R) -> void { int posl = l/mod,lmod = l%mod; int posL = L/mod,Lmod = L%mod; int len = r-l; while(len >= mod){ if(lmod <= Lmod){ int movebit = mod-Lmod; len -= movebit; ull bring = A.at(posl)&((1ULL<<(lmod+movebit))-(1ULL<>lmod)<>lmod)< 0){ A.at(posL) ^= A2.at(posL); A2.at(posL) = 0; posL++,len -= mod; } }; int Q; cin >> Q; while(Q--){ int l,r,L,R; cin >> l >> r >> L >> R; move(l-1,r,L-1,R); } pos = 0,bit = 0; for(int i=0; i>= 1; bit++; if(bit == mod) bit = 0,pos++; } cout << endl; }