mod = 10**9 + 7 a, b, t = gets.strip.split.map(&:to_f) puts ((0.5 * a * t) + (0.5 * b * t)).round % mod