#include "bits/stdc++.h" using namespace std; #define DEBUG(x) cout<<#x<<": "< #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector #define pii pair #define pis pair #define psi pair #define pll pair #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) #define all(c) c.begin(),c.end() const int inf = 1000000001; const ll INF = 2e18; const ll MOD = 1000000007; const ll mod = 1000000009; const double pi = 3.14159265358979323846; #define Sp(p) cout<> 7); seed = seed ^ (seed << 17); return (seed >> 33); } int main() { ll n, q; cin >> n >> q >> seed; ll M = (1LL << 31) - 1; for (int i = 0; i < 10000; i++) next(); vl a(n); for (int i = 0; i < n; i++) a[i] = next(); sort(a.begin(), a.end()); ll m = (1LL << 31) / n; vll G(n + 5); rep(i, n) { G[a[i] / m].push_back(a[i]); } vi cnt(n + 6); rep(i, n + 5) { cnt[i + 1] = cnt[i] + G[i].size(); } ll sum = 0; rep(i, q) { ll x = next(); ll temp = cnt[x / m]; rep(j, G[x / m].size()) { if (G[x / m][j] < x) { temp++; } else { break; } } sum ^= temp*i; } cout << sum << endl; }