A,B,C = map(int,input().split()) K = int(input()) mod = 10**9+7 s = (A*B)*(A*C)*(B*C) print(pow(s,K,mod))