M=1000000007 A,B,C=map(int,input().split()) K=int(input()) E=pow(2,K,M-1) F=pow(A*B*C,E,M) print(F)