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

int main(){
  int64_t A, B, K;
  cin >> A >> B >> K;
  for(int i=0; i<K; i++){
    if(i%2==0){
      A=2*(A/2);
      B+=A/2;
      A/=2;
    }
    else{
      B=2*(B/2);
      A+=B/2;
      B/=2;
    }
  }
  cout << A << " " << B << endl;
}
#include<iostream>
#include<iomanip>
#include<cmath>

using namespace std;

int main()
{
	double x1,x2,y1,y2,p;
	cin>>x1>>y1>>x2>>y2;
	
	x1=x2-x1;
	y1=y2-y1;
	
	x1=sqrt(x1*x1+y1*y1);
	
	cout<<setprecision(10)<<x1<<endl;
		
	return 0;
}         