voidupdate(int x, int v){ if (x > n) return ; for (int o = 0; o < 30; ++o) { if (v >> o & 1) d[x] ^= 1 << o; int k = (((v >> o) + 1) << o) - v + x; if (k <= n) tag[k][o] ^= 1; } }
inlinevoidsolve_1(){ int x, y, z; cin >> x >> y >> z; d[x] ^= z; d[y + 1] ^= z; }
inlinevoidsolve_2(){ int x, y, z; cin >> x >> y >> z; update(x, z); update(y + 1, z + y - x + 1); }
cin >> n >> m; for (int i = 1; i <= n; ++i) cin >> a[i]; for (int i = 1; i <= m; ++i) { int opt; cin >> opt; if (opt == 0) solve_1(); else solve_2(); } for (int o = 0; o < 30; ++o) for (int i = 1; i <= n; ++i) { if (i + (1 << o) <= n) tag[i + (1 << o)][o] ^= tag[i][o]; if (tag[i][o]) d[i] ^= 1 << o; } for (int i = 1; i <= n; ++i) d[i] ^= d[i - 1], cout << (a[i] ^ d[i]) << " \n"[i == n]; return0; }