#include<bits/stdc++.h>
// */
using namespace std;
#define int long
signed main(){
  int a,b,k;
  cin>>a>>b>>k;
  for(int i=0;i<k;++i){
    if(i&1)a+=b/2,b/=2;
    else b+=a/2,a/=2;
  }
  cout<<a<<" "<<b;
}