#include int main() { long t,p; int a,b; scanf("%d%d%ld",&a,&b,&t); p=0.5*t*a+0.5*t*b; printf("%d",p%(1000000000+7)); return 0; }