#include #include using namespace std; int main () { int n, a, b; scanf ("%d %d %d", &a, &b, &n); printf ("%d ", a + b); int elem = n; long long pas = 1LL; for (; n > 2;) { if (!(n & 1)) elem -= pas; n = (n + 1) / 2; pas *= 2LL; } printf ("%lld\n", 1LL * a * elem + 1LL * b); return 0; }