#include #include using namespace std; int main( void ){ int x, y, z, l, k; cin >> x >> y >> z >> l; // Cislo tam neni if(x != l && y != l){ cout << 0 << endl; return 0; } // Stejny cisla, jedina moznost if(x == y){ k = 1; }else{ k = z * pow(2, (z-1)); } cout << (k % 1000000007) << endl; return 0; }