#include <stdio.h>
#include <string.h>

int main(void)
{
	int x,y,z,a=0,b,c;
	scanf("%d %d %d",&x,&y,&z);
	while(a < z)
	{
		if(x%2) x--;
		c = x/2;
		x/=2;
		y+=c;
		a++;
		if (a >= z) break;
		if (y%2) y--;
		c = y/2;
		y/=2;
		x+=c;
		a++;
	}
	printf("%d %d",x,y);
	return 0;
}