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); int a = sc.nextInt(); int b = sc.nextInt(); int t = sc.nextInt(); int n=1; for(int i=0; i < t; i++){ n =(int) (0.5*a + 0.5*b)*n; } int m = 1000000007; System.out.println(n%m); } }