import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long arate=sc.nextLong(); long brate=sc.nextLong(); long time=sc.nextLong(); long finalvalue=(arate*time/2 + brate*time/2)%(10^9+7); System.out.println(finalvalue); } }