# Enter your code here. Read input from STDIN. Print output to STDOUT a, b, t = gets.split(' ').map(&:to_i) puts ((0.5*a*t + 0.5*b*t) % (10**9 + 7)).to_i