import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static long my_pow(int nr, long pow){ long mod =(long) Math.pow(10,9) + 7; if(pow == 1){ return nr; } if(pow % 2 == 0){ long rez = my_pow(nr, pow/2) % mod; return rez * rez % mod; } else{ return nr * my_pow(nr, pow - 1) % mod; } } 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); int a = sc.nextInt(); int b = sc.nextInt(); long t = sc.nextLong(); System.out.println(my_pow(((a+b)/2), t)); } }