#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair P; typedef unsigned long long ull; ull seed; int next() { seed = seed ^ (seed << 13); seed = seed ^ (seed >> 7); seed = seed ^ (seed << 17); return (seed >> 33); } int main() { int n, q; cin>>n>>q>>seed; for (int i = 0; i < 10000; i++) next(); vector v[1<<18]; for (int i = 0; i < n; i++){ int a = next(); v[a/(1<<13)].push_back(a); } int s[1<<18]; s[0]=v[0].size(); for(int i=1; i<(1<<18); i++){ s[i]=s[i-1]+v[i].size(); } ll sm=0; for(ll i=0; i=x) ans--; } sm^=(ans*i); } cout<