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