(a,b,t) = [int(foo) for foo in input().strip().split()] cells = 1 for second in range(t): growth = (.5*a + .5*b) cells = int(cells * growth % (10 ** 9 + 7)) print(cells)