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