p = 10**9+7 comb = Array.new(76){[0]*76} comb[0][0] = 1 Gx,Gy,K = gets.split().map{|s| s.to_i} (0..K*15-1).each{|i| (0..i+1).each{|j| if j > 0 then comb[i+1][j] = (comb[i][j] + comb[i][j-1]) % p else comb[i+1][j] = comb[i][j] end } } G = [Gx,Gy]; dp = [nil]*(1< 0 mul = [1<>(i*4))%16} (0..K-1).each{|i| dup_n = (k>>(i*4))%16; tmp = tmp * comb[total][dup_n] % p; total-=dup_n; } ans = (ans + tmp) % p; } p ans