# Enter your code here. Read input from STDIN. Print output to STDOUT l,m,n=raw_input().strip().split(" ") a,b,t=int(l),int(m),int(n) print int((a*0.5*t+b*0.5*t)%(1000000007))