#include "bits/stdc++.h"
using namespace std;
#define int long long
int mod=1e9+7;

signed main(){
  int a,b,k;
  cin>>a>>b>>k;
  for(int i=0;i<k;i++){
    if(i%2==0){
      a/=2;
      b+=a;
    }else{
      b/=2;
      a+=b;
    }
  }
  cout<<a<<" "<<b<<endl;
}
