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