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 in = new Scanner(System.in); BigInteger a = new BigInteger(in.next()); BigInteger b = new BigInteger(in.next()); BigInteger t = new BigInteger(in.next()); BigInteger mod = new BigInteger("1000000007"); BigInteger div = new BigInteger("2"); BigInteger cells; cells = a.add(b); cells = cells.divide(div); cells = cells.modPow(t, mod); System.out.println(cells); } }