import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner s = new Scanner(System.in); int a = s.nextInt(); int b = s.nextInt(); long t = s.nextLong(); long c = (a + b) / 2; List extra = new ArrayList(); while (t != 1) { if (t % 2 == 1) extra.add(c); t = t / 2; c = (c * c) % 1000000007; } for (long l : extra) { c = (c * l) % 1000000007; } System.out.println(c); } }