import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner input = new Scanner(System.in); double a = input.nextDouble(); double b = input.nextDouble(); int t = input.nextInt(); int expected = 1; //for(int i = 0; i < t; i++){ expected = ((int)(0.5*a*t) + (int)(0.5*b*t))%(int)((Math.pow(10,9))+7); //} System.out.print(expected); } }