#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair const ll MOD = 1e9+7; ll pow(ll n, ll r, ll p) { if (r == 0) return 1LL; if (r == 1) return n%p; if (r%2==0) { ll t = pow(n, r/2, p); return (t*t)%p; } ll t = pow(n,r/2, p); ll res = t*t; res %= p; res *= n; res %= p; return res; } int main() { ll a, b, c, k; cin >> a >> b >> c >> k; ll now = a*b; now %= MOD; now *= c; now %= MOD; ll cnt = pow(2LL,k, MOD-1); ll ans = pow(now, cnt, MOD); cout << ans << endl; }