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. */ // System.out.println(Integer.MAX_VALUE); // System.out.println(Integer.MAX_VALUE - Math.pow(10, 9) + 7); Scanner scan = new Scanner(System.in); String inputs = scan.nextLine(); System.out.println(numCells(Integer.parseInt(inputs.substring(0, 1)), Integer.parseInt(inputs.substring(2, 3)), Integer.parseInt(inputs.substring(4, 5)))); } public static int numCells(int a, int b, int t) { double totCells = 1; while (t > 0) { totCells = 0.5 * a * totCells + 0.5 * b * totCells; t--; } totCells = totCells % (Math.pow(10, 9) + 7); return (int) totCells; } }