#include #include using std::cin; using std::cout; using namespace atcoder; using mint = modint1000000007; using ll = long long; int main() { ll a, b, c, k; cin >> a >> b >> c >> k; mint x = a * b * c; int p = pow_mod(2, k, 1000000006); mint ans = x.pow(p); cout << ans.val() << '\n'; return 0; }