require'prime' def x(a,d,n,t) 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={} M=10**9+7 H,W,K=gets.split.map &:to_i B=W.prime_division x(H.prime_division,r=0,1,1){|a,at| x(B,0,1,1){|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