#include #include #include #include #include using namespace std; #define LIM 1000000007; int main() { int a, b; unsigned long long t; cin >> a >> b >> t; unsigned long long value = (a+b)/2; t %= LIM; unsigned long long output = (value * t) % LIM; cout << output << "\n"; return 0; }