#include #define INF 1E9 using namespace std; inline void debugMode() { #ifndef ONLINE_JUDGE freopen("debug.in", "r", stdin); #endif // ONLINE_JUDGE } int main() { ios :: sync_with_stdio(false); debugMode(); int a,b,n,p = 1; cin >> a >> b >> n; int cn = n; while(cn % 2 == 0 && cn > 2){ p *= 2; cn /= 2; } cout << a + b << " " << a * (n - p + 1) + b; return 0; }