#include #include using namespace std; int n,q,A[200010]; unsigned long long seed; long long ans; int next() { seed = seed ^ (seed << 13); seed = seed ^ (seed >> 7); seed = seed ^ (seed << 17); return (seed >> 33); } void step(int x,int &y,int v) { while(y > 0 && A[y] >= x) y -= v; if(y < 0) y = 0; while(y < n && A[y+1] < x) y += v; if(y > n) y = n; } int main() { int i,x,y,z; scanf("%d%d%llu",&n,&q,&seed); for(i=0;i<10000;i++) next(); for(i=1;i<=n;i++) A[i] = next(); sort(A+1,A+n+1); for(i=0;i> 31; if(y > n) y = n; step(x,y,15); step(x,y,1); ans ^= 1LL*i*y; } printf("%lld",ans); return 0; }