MOD = 10**9+7 A, B, C = map(int, input().split()) K = int(input()) z = A*B%MOD*C%MOD p = pow(2, K, MOD-1) ans = pow(z, p, MOD) print(ans)