#include #define endl '\n' using namespace std; const long long int a1=1,maxn=1e7+1; long long int a,b0,b[maxn],t,v[maxn],c,d,n,i,j=2,ans,mod; void speed() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } void stepen(long long int ch) { for(; j<=ch; j++) { t*=t; t%=mod; } } void neshto() { b[0]=b0; for(i=1; i<=n; i++) { b[i]=(b[i-1]*c+d)%mod; // cout<1)v[i]^=v[i-1]; // cout<>a>>b0>>c>>d>>n; t=a; mod=a1<<32; neshto(); return 0; }