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 sc = new Scanner(System.in); BigInteger a = sc.nextBigInteger(); BigInteger b = sc.nextBigInteger(); BigInteger t = sc.nextBigInteger(); BigInteger bi1, bi2, bi3; bi1 = a.add(b); BigDecimal tmp = new BigDecimal("0.5"); tmp = tmp.multiply(new BigDecimal(bi1)); bi1 = tmp.toBigInteger(); bi2 = new BigInteger("1000000007"); bi3 = bi1.modPow(t, bi2); System.out.println( bi3+"" ); } }