package main import "fmt" func main() { var ( a,b,t int; ) fmt.Scan(&a,&b,&t) fmt.Println(int(0.5*float64(a*t)+0.5*float64(b*t))%(1000000007)) }