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. */ int a,b,t; long nov; Scanner sc = new Scanner(System.in); a = sc.nextInt(); b = sc.nextInt(); t = sc.nextInt(); nov =(long) ((0.5 * a * t) +( 0.5 * b * t))%(1000000000+7); System.out.println(nov); } }