#include <bits/stdc++.h>
using namespace std; 
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ll long long
long long min(long long x,long long y){return (x<y ? x:y);}
long long max(long long x,long long y){return (x>y ? x:y);}
#define ld long double
int stoi(string s) {return atoi(s.c_str());}
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
#define LINEY "YES\n"
#define Liney "Yes\n"
#define LINEN "NO\n"
#define Linen "No\n"

void func(ll* x,ll* y){
  *x -= (*x%2);
  *x /= 2;
  *y += *x;
}

int main(){
  ll A,B;
  int K;
  cin >> A>>B>>K;
  bool turn_A = true;
  REP(i,K){
    if(turn_A){func(&A,&B);}
    else{func(&B,&A);}
    turn_A = !turn_A;
  }
  printf("%d %d\n",A,B);
}
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int a, b, k;
  cin >> a >> b >> k;
  int tk = a, ao = b;
  for (int i = 0; i < k; ++i) {
    if (i % 2 == 0) {
      if (tk & 1) {
        tk--;
      }
      ao += tk / 2;
      tk /= 2;
    } else {
      if (ao & 1) {
        ao--;
      }
      tk += ao / 2;
      ao /= 2;
    }
  }
  cout << tk << " " << ao << endl;
  return 0;
}