require'prime' def x(a,d,n=1,t=1)d==a.size ?yield(n,t):(0..a[d][1]).map{|i|x(a,d+1,n*a[d][0]**i,i==0?t:t*(a[d][0]-1)*a[d][0]**(i-1),&proc)}end q=->x,y{z=1;(y%2>0&&z=z*x%M;x=x*x%M;y/=2)while y>0;z} C={} r=M=10**9+7 H,W,K=gets.split.map &:to_i x(H.prime_division,0){|a,at| x(W.prime_division,0){|b,bt| k=W*H*a.gcd(b)/a/b C[k]=q[K,k]if !C.has_key?k r=(r+at*bt*C[k])%M } } p r*q[W*H,M-2]%M