#include<iostream> #include<bitset> #define maxn 100010 #define ll long long usingnamespacestd;
constint N = 100001;
int n, m, a[maxn];
structQuery { int opt, x, y; } Q[maxn];
voidwork(){ cin >> n >> m; for (int i = 1; i <= n; ++i) cin >> a[i]; for (int i = 1; i <= m; ++i) { cin >> Q[i].opt >> Q[i].x; if (Q[i].opt == 1) cin >> Q[i].y; } bitset<N> B, low, high; for (int i = m; i; --i) { int opt = Q[i].opt, x = Q[i].x, y = Q[i].y; if (opt == 1) { low = B & ~bitset<N>(0) >> N - y - 1; high = B & ~bitset<N>(0) << y + 1; B = low ^ high >> y - x + 1; } else B.flip(x); } int ans = 0; for (int i = 1; i <= n; ++i) if (B[i]) ans ^= a[i]; cout << ans << "\n"; }