# Enter your code here. Read input from STDIN. Print output to STDOUT lst=list() i=raw_input() lst=i.split() if len(lst)==3: a=float(lst[0]) b=float(lst[1]) n=int(lst[2]) grow=((0.5*a)+(0.5*b))*n rate=grow%(10**9+7) print long(rate)