def egcd(a, b): if a == 0: return (b, 0, 1) else: g, y, x = egcd(b % a, a) return (g, x - (b // a) * y, y) def modinv(a, m): g, x, y = egcd(a, m) if g != 1: raise Exception('modular inverse does not exist') else: return x % m def f(a, b, t, m): c2 = pow(a+b, t, m) c1 = pow(2, t, m) mi = modinv(c1, m) return (c2*mi) % m a, b, t = map(int, raw_input().strip().split(' ')) print f(a, b, t, 10**9 + 7)