#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int unsigned long long
#define endl '\n'
#define pb push_back
#define debug(x) cout<<#x<<" "<<x<<endl;
const int mod = 1e9+7;
const int MAX = 2e5+7;
const int INF = INT_MAX;
const double pi = 3.141592653589793238460;
using namespace std;
bool is_pal (string s){
return equal(s.begin(), s.begin() + s.size()/2, s.rbegin()) ? 1 : 0;
}
int power (int x , int y){
if(y==0){
return 1;
}
if(y&1){
return x*power(x,y/2)%mod*power(x,y/2)%mod;
}
return power(x,y/2)%mod*power(x,y/2)%mod;
}
int modInv (int x){
return power(x,mod-2);
}
int fact (int n){
int f =1;
for(int i=0; i<n; i++){
f=(f*(i+1))%mod;
}
return f;
}
int max (int x, int y){
return x>y ? x : y;
}
int min (int x, int y){
return x<y ? x : y;
}
int lcm (int x, int y){
return (x*y)/__gcd(x,y);
}
bool prime[MAX];
void SieveOfEratosthenes(int n){
memset(prime, true, sizeof(prime));
for (int p=2; p*p<=n; p++){
if (prime[p] == true){
for (int i=p*p; i<=n; i += p)
prime[i] = false;
}
}
}
int tree[4*MAX];
int lazy[4*MAX];
void build(int a[], int v, int tl, int tr, int tree[], int lazy[]) {
lazy[v]=0;
if (tl == tr) {
tree[v] = a[tl];
} else {
int tm = (tl + tr) / 2;
build(a,v*2,tl,tm,tree,lazy);
build(a,v*2+1,tm+1,tr,tree,lazy);
tree[v] = (tree[v*2] ^ tree[v*2+1]);
}
}
void push(int v, int tree[], int lazy[]) {
tree[v*2] += lazy[v];
lazy[v*2] += lazy[v];
tree[v*2+1] += lazy[v];
lazy[v*2+1] += lazy[v];
lazy[v] = 0;
}
void updateADDEND(int v, int tl, int tr, int l, int r, int addend, int tree[], int lazy[]) {
if (l > r)
return;
if (l == tl && tr == r) {
tree[v] += addend;
lazy[v] += addend;
} else {
push(v,tree,lazy);
int tm = (tl + tr) / 2;
updateADDEND(v*2, tl, tm, l, min(r, tm), addend,tree,lazy);
updateADDEND(v*2+1, tm+1, tr, max(l, tm+1), r, addend,tree,lazy);
tree[v] = min(tree[v*2], tree[v*2+1]);
// this min is completely immaterial and is same as build ones
}
}
int queryMIN(int v, int tl, int tr, int l, int r) {
if (l > r)
return INF;
if (l <= tl && tr <= r)
return tree[v];
push(v, tree, lazy);
int tm = (tl + tr) / 2;
return min(queryMIN(v*2, tl, tm, l, min(r, tm)),
queryMIN(v*2+1, tm+1, tr, max(l, tm+1), r));
}
int queryMAX(int v, int tl, int tr, int l, int r) {
if (l > r)
return -INF;
if (l <= tl && tr <= r)
return tree[v];
push(v, tree, lazy);
int tm = (tl + tr) / 2;
return max(queryMAX(v*2, tl, tm, l, min(r, tm)),
queryMAX(v*2+1, tm+1, tr, max(l, tm+1), r));
}
void updatePOINT(int v, int tl, int tr, int pos, int new_val) {
if (tl == tr) {
tree[v] = new_val;
} else {
int tm = (tl + tr) / 2;
if (pos <= tm)
updatePOINT(v*2, tl, tm, pos, new_val);
else
updatePOINT(v*2+1, tm+1, tr, pos, new_val);
tree[v] = (tree[v*2] + tree[v*2+1]);
}
}
int rangeSUM(int v, int tl, int tr, int l, int r) {
if (l > r)
return 0;
if (l == tl && r == tr) {
return tree[v];
}
int tm = (tl + tr) / 2;
return rangeSUM(v*2, tl, tm, l, min(r, tm))
^ rangeSUM(v*2+1, tm+1, tr, max(l, tm+1), r);
}
int getVALUE(int v, int tl, int tr, int pos) {
if (tl == tr) {
return tree[v];
}
push(v, tree, lazy);
int tm = (tl + tr) / 2;
if (pos <= tm)
return getVALUE(v*2, tl, tm, pos);
else
return getVALUE(v*2+1, tm+1, tr, pos);
}
void solve(void){
int n, q;
cin>>n>>q;
int a[MAX]={0};
for(int i = 1; i <= n; i++)
cin>>a[i];
build (a, 1, 1, n, tree, lazy);
while(q--){
int qtype, l, r;
cin>>qtype;
if(qtype&1){
int A, B, U;
cin>>A>>B>>U;
}
else{
int K;
cin>>K;
}
}
}
signed main() {
fio;
int t = 1;
// cin>>t;
while(t--)
solve();
return 0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CgogICAgbGF6eVt2KjJdICs9IGxhenlbdl07CgogICAgdHJlZVt2KjIrMV0gKz0gbGF6eVt2XTsKCiAgICBsYXp5W3YqMisxXSArPSBsYXp5W3ZdOwoKICAgIGxhenlbdl0gPSAwOwoKfQoKCgp2b2lkIHVwZGF0ZUFEREVORChpbnQgdiwgaW50IHRsLCBpbnQgdHIsIGludCBsLCBpbnQgciwgaW50IGFkZGVuZCwgaW50IHRyZWVbXSwgaW50IGxhenlbXSkgewoKICAgIGlmIChsID4gcikKCiAgICAgICAgcmV0dXJuOwoKICAgIGlmIChsID09IHRsICYmIHRyID09IHIpIHsKCiAgICAgICAgdHJlZVt2XSArPSBhZGRlbmQ7CgogICAgICAgIGxhenlbdl0gKz0gYWRkZW5kOwoKICAgIH0gZWxzZSB7CgogICAgICAgIHB1c2godix0cmVlLGxhenkpOwoKICAgICAgICBpbnQgdG0gPSAodGwgKyB0cikgLyAyOwoKICAgICAgICB1cGRhdGVBRERFTkQodioyLCB0bCwgdG0sIGwsIG1pbihyLCB0bSksIGFkZGVuZCx0cmVlLGxhenkpOwoKICAgICAgICB1cGRhdGVBRERFTkQodioyKzEsIHRtKzEsIHRyLCBtYXgobCwgdG0rMSksIHIsIGFkZGVuZCx0cmVlLGxhenkpOwoKICAgICAgICB0cmVlW3ZdID0gbWluKHRyZWVbdioyXSwgdHJlZVt2KjIrMV0pOyAKCiAgICAgICAgLy8gdGhpcyBtaW4gaXMgY29tcGxldGVseSBpbW1hdGVyaWFsIGFuZCBpcyBzYW1lIGFzIGJ1aWxkIG9uZXMKCiAgICB9Cgp9CgoKCmludCBxdWVyeU1JTihpbnQgdiwgaW50IHRsLCBpbnQgdHIsIGludCBsLCBpbnQgcikgewoKICAgIGlmIChsID4gcikKCiAgICAgICAgcmV0dXJuIElORjsKCiAgICBpZiAobCA8PSB0bCAmJiB0ciA8PSByKQoKICAgICAgICByZXR1cm4gdHJlZVt2XTsKCiAgICBwdXNoKHYsIHRyZWUsIGxhenkpOwoKCg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