#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); } 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 n) y = n; if(A[y] < x) y = n; ans ^= 1LL*i*(lower_bound(A+1,A+y+1,x)-A-1); } printf("%lld",ans); return 0; }