x=input ().split() y=(int(input())*2)%(10**9+7) z=(int(x[0])*int(x[1])*int(x[2])) print ((z**y)%(10**9+7))