#include <iostream>
using namespace std;

int main(){
    int a, b, k;
    cin >> a >> b >> k;

    for(int i=0;i<k;i++) {
        a /= 2;
        b += a;
        i++;
        if(i==k) break;
        b /= 2;
        a += b;
    }

    cout << a << " " << b << endl;

    return 0;
}
