#include using namespace std; using LL = long long; const int mod = 1e9 + 7; LL pow_mod(LL x, LL p, int mod){ LL s = 1; for(; p; p>>=1){ if(p & 1) s = s * x % mod; x = x * x % mod; } return s; } int main(){ LL a, b, c, K; scanf("%lld %lld %lld %lld", &a, &b, &c, &K); printf("%lld\n", pow_mod(a * b % mod * c % mod, pow_mod(2, K, mod - 1), mod)); return 0; }