#include<iostream>
using namespace std;

int main(){
  int A,B,K;
  cin >> A >> B >> K;
  for(int i=0;i<K;i++){
	if(A%2==1){
	  A--;
	}
	B+=A/2;
	A/=2;
	int t=A;
	A=B;
	B=t;
  }

  if(K%2==1){
	int t=A;
	A=B;
	B=t;	
  }

  cout << A << " " << B << endl;
  return 0;
  
}