import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); BigDecimal time = sc.nextBigDecimal(); BigDecimal result = time.multiply(new BigDecimal(a)).divide(new BigDecimal(2)); result = result.add(time.multiply(new BigDecimal(b)).divide(new BigDecimal(2))); result = result.remainder(new BigDecimal(1000000000).add(new BigDecimal(7))); System.out.println(result); } }