#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; const ll mod = 1000000007; ll a, b, c, k, x, y; int main() { cin >> a >> b >> c >> k; x = a * b % mod; x = x * c % mod; y = pow_mod(2, k, mod - 1); cout << pow_mod(x, y, mod) << endl; return 0; }