#include #include using mint = atcoder::modint1000000007; using namespace std; using ll = long long; int main() { int a, b, c; cin >> a >> b >> c; ll k; cin >> k; atcoder::modint::set_mod(1000000007 - 1); int l = atcoder::modint(2).pow(k).val(); mint t = mint(a) * b * c; cout << t.pow(l).val() << endl; return 0; }