#include #include using namespace std; using namespace atcoder; #define ll int64_t #define u32 uint32_t #define u64 uint64_t constexpr ll inf = 1e17; constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}; constexpr int dy[] = {1, 0, -1, 0, 1, -1, 1, -1}; #define pii pair #define pll pair #define endl "\n" #define Auto const auto #define all(a) a.begin(),a.end() #define overload(_1,_2,_3,_4,name,...) name #define _rep1(n) for(int i = 0; i < (n); i++) #define _rep2(i,n) for(int i = 0; i < (n); i++) #define _rep3(i,a,b) for(int i = (a); i < (b); i++) #define _rep4(i,a,b,c) for(int i = (a); i < (b); i += (c)) #define rep(...) overload(__VA_ARGS__,_rep4,_rep3,_rep2,_rep1)(__VA_ARGS__) #define _rrep1(n) for(int i = (n) - 1; i >= 0; i--) #define _rrep2(i,n) for(int i = (n) - 1; i >= 0; i--) #define _rrep3(i,a,b) for(int i = (b) - 1; i >= (a); i--) #define _rrep4(i,a,b,c) for(int i = (b) - 1; i >= (a); i -= (c)) #define rrep(...) overload(__VA_ARGS__,_rrep4,_rrep3,_rrep2,_rrep1)(__VA_ARGS__) #define F function template inline bool chmin(T& a, T b){ if(a > b){ a = b; return 1; } return 0; } template inline bool chmax(T& a, T b){ if(a < b){ a = b; return 1; } return 0; } struct Edge { int to; ll cost; Edge(int to, ll cost) : to(to), cost(cost) {} }; using Graph = vector>; template istream& operator>>(istream& is, vector& a){ for(auto& x : a) is >> x; return is; } template void operator+=(vector& a, T b){ a.push_back(b); return; } template istream& operator>>(istream& is, set& a){ T input; is >> input; a.insert(input); return is; } template void operator+=(set& a, T b){ a.insert(b); return; } struct sorted_impl{ template friend vector operator|(vector a, sorted_impl){ sort(all(a)); return a; } template friend void operator|=(vector& a, sorted_impl){ sort(all(a)); } } sorted; struct reversed_impl{ template friend vector operator|(vector a, reversed_impl){ reverse(all(a)); return a; } template friend void operator|=(vector& a, reversed_impl){ reverse(all(a)); } } reversed; ll mow(ll x, ll n){ ll ret = 1; while(n > 0){ if(n & 1) ret = ret * x; x = x * x; n >>= 1; } return ret; } ll mow(ll x, ll n, ll mod){ ll ret = 1; while(n > 0){ if(n & 1) ret = ret * x % mod; x = x * x % mod; n >>= 1; } return ret; } void Main(){ constexpr ll mod = 1000000007; ll a, b, c, k; cin >> a >> b >> c >> k; cout << mow((((a * b) % mod) * c) % mod, mow(2, k, mod - 1), mod) << endl; } signed main(){ cin.tie(0); ios::sync_with_stdio(0); cout << setprecision(10) << fixed; Main(); }