#include #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() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x,y) x=min(x,y) #define chmax(x,y) x=max(x,y) using namespace std; template ostream& operator<<(ostream& o,const pair &p){return o<<"("< ostream& operator<<(ostream& o,const vector &vc){o<<"sz = "<>7); seed = seed ^ (seed<<17); return (seed>>33); } const int X = 17; const int B = 1< a[B]; int acc[B+1]; int main(){ int N,Q; cin>>N>>Q>>seed; rep(i,10000) next(); rep(i,N){ int x = next(); a[x>>(31-X)].pb(x); } rep(i,B) sort(all(a[i])); rep(i,B) acc[i+1] = acc[i] + a[i].size(); ll res = 0; rep(qt,Q){ int x = next(); int b = x>>(31-X); int cnt = acc[b] + lower_bound(all(a[b]),x) - a[b].begin(); res ^= ll(cnt)*qt; } cout<