a, b, t = map(int, input().split()) amount = int(0.5*a*t+0.5*b*t) print(amount % (10**9 + 7))