#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)

int main() {
    int k;
    vector<int> ab{0, 0};
    cin >> ab[0] >> ab[1] >> k;

    int i = 0;
    while (k--) {
        if (ab[i] & 1) {
            ab[i]--;
        }
        ab[i] >>= 1;
        ab[i ^ 1] += ab[i];
        i ^= 1;
    }
    cout << ab[0] << " " << ab[1] << endl;
}
#include <bits/stdc++.h>
using namespace std;
char s[100];
int main(){
    int a, b, k;
    scanf("%d%d%d", &a, &b, &k);
    for(int i=0;i<k;i++){
        if(i%2 == 0){
            if(a%2 != 0) a--;
            b += a/2;
            a/=2;
        }
        else{
            if(b%2 != 0) b--;
            a += b/2;
            b/=2;
        }
    }
    printf("%d %d\n", a, b);
}