import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int speed1 = input.nextInt(); int speed2= input.nextInt(); long count = 1; long miliseconds = input.nextInt(); for(int time = 0; time < miliseconds; time++){ count =(int) (count * speed1 * 0.5 + count * speed2 * 0.5); } System.out.println((int) (count % (Math.pow(10,9)+7))); } }