function getLines(input){
	return input.split("\n").map((s)=>s.trim())
}
function parseLine(line){
	return line.split(" ").map((s)=>s.trim());
}
function parseLineToInt(line){
	return line.split(" ").map((s)=>parseInt(s.trim()));
}
// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.	
	var s = parseLineToInt(input)
	var a=s[0],b=s[1],k=s[2];
	var turn = true;
	while(k>0){
		if(turn){
			if(a%2==1){
				a--;
			}
			a/=2;
			b+=a;
		}else{
			if(b%2==1){
				b--;
			}
			b/=2;
			a+=b;
		}	
		turn=!turn
		k--;
	}
	console.log(a,b)
	
}
// Don't edit this line!
//Main(require("fs").readFileSync(__dirname+'/in.txt', "utf8"));
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
