#include<stdio.h>
#include<algorithm>

using namespace std;

int main(void)
{
	int a,b,k; scanf("%d %d %d",&a,&b,&k);
	int p=0;
	while(k--)
	{
		if(p%2==0)
		{
			b += a/2;
			a/=2;
		}
		else
		{
			a+=b/2;
			b/=2;
		}
		p++;
	}
	printf("%d %d",a,b);
	return 0;
}