#include using namespace std; #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i,n) for (int i = 0; i < (n); ++i) typedef long long ll; using P=pair; const int INF=INT_MAX; const int mod=1e9+7; ll mod_pow(ll n,ll x,ll m){ if(x==0){return 1;} ll res=mod_pow(n*n%m,x/2,m); if(x&1){res=res*n%m;} return res; } void solve(){ ll a,b,c,k; cin>>a>>b>>c>>k; ll x=a; x=x*b%mod; x=x*c%mod; ll res=mod_pow(2,k,mod-1); cout<