#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> AB(2);
    for (int i=0;i<2;++i) cin >> AB[i];
    int K; cin >> K;
    for (int i=0;i<K;++i){
        if (AB[i&1]&1) --AB[i&1];
        AB[(i&1)^1]+=AB[i&1]/2;
        AB[i&1]/=2;
    }
    cout << AB[0] << ' ' << AB[1] << '\n';
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  ll a, b, k;
  cin >> a >> b >> k;
  rep(i, k) {
    if (i%2) {
      if (b%2) {
        b--;
        a += b/2;
        b /= 2;
      } else {
        a += b/2;
        b /= 2;
      }
    } else {
      if (a%2) {
        a--;
        b += a/2;
        a /= 2;
      } else {
        b += a/2;
        a /= 2;
      }
    }
  }
  cout << a << ' ' << b << endl;
}