#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n >> m >> k; //鳩の巣よりそれぞれ2^10種類 vector a(n), b(m); vector x(1024, 0), y(1024, 0); vector cnt1(1024, 0), cnt2(1024, 0); x[0] = y[0] = 1; ll now = 0; for(int i=0;i> t; now^=t; x[now]++; } now = 0; for(int i=0;i> t; now^=t; y[now]++; } ll P = 1000000007; for(int i=0;i<1024;i++){ ll now = x[i]; if(now==0) continue; for(int j=0;j<1024;j++){ ll to_num = x[j]; if(i==j) to_num--; cnt1[i^j] += now * to_num; } } for(int i=0;i<1024;i++){ ll now = y[i]; if(now==0) continue; for(int j=0;j<1024;j++){ ll to_num = y[j]; if(i==j) to_num--; cnt2[i^j] += now * to_num; } } for(int i=0;i<1024;i++) cnt1[i]/=2, cnt2[i]/=2; for(int i=0;i<1024;i++) cnt1[i]%=P, cnt2[i]%=P; ll ans = 0; for(int i=0;i<1024;i++){ ll need = k^i; ans = (ans + (cnt1[i] * cnt2[need])%P)%P; } std::cout << ans << '\n'; }