import java.io.*; import java.util.*; 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 in = new Scanner(System.in); long p1 = in.nextInt(); long p2 = in.nextInt(); long time = in.nextInt(); long mod = (long) (Math.pow(10, 9) + 7); long answer = ((p1*time/2)+(p2*time/2))%mod; System.out.println(answer); } }