#include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main(){ long long a,b,c,k; cin >> a >> b >> c; cin >> k; long long tmp_a,tmp_b,tmp_c,tmp_multi; long long digit = pow(2,k); digit %= MOD-1; tmp_a = (long long)pow(a,digit); tmp_b = (long long)pow(b,digit); tmp_c = (long long)pow(c,digit); tmp_multi = tmp_a * tmp_b * tmp_c; cout << tmp_multi%MOD << endl; return 0; }