import java.io.*; import java.util.*; import java.math.*; public class Solution { public static void virus(int a, int b, int t){ double c; c = Math.pow(0.5,t); double sum = 0; for (int k=0; k<=t; k++){ sum = sum + (Math.pow(a,t-k))*(Math.pow(b,k)); } sum = sum*c; double finalsum = sum%(Math.pow(10,9)+7); long ppp = Math.round(finalsum); System.out.println(ppp); } 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,b; int t; a = sc.nextInt(); b = sc.nextInt(); t = sc.nextInt(); virus(a,b,t); } }