import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigDecimal; import java.math.BigInteger; public class Sol { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String[] s = reader.readLine().split(" "); int x = Integer.parseInt(s[0]) + Integer.parseInt(s[1]); long t = Long.parseLong(s[2]); BigInteger z = new BigInteger("" + x); z = z.divide(new BigInteger("2")); z = z.modPow(new BigInteger("" + t), new BigInteger("1000000007")); System.out.println(z); reader.close(); } }