function Main(input) {
  var A = parseInt(input.split(" ")[0]);
  var B = parseInt(input.split(" ")[1]);
  var K = parseInt(input.split(" ")[2]);
  var turn = true;//true:高橋君、false:青木君
  
  for(var i = 0; i < K; i++){
    if(turn){
       if(A % 2 == 1){
          A--;
       }
       A = A / 2;
       B += A;
       turn = false;
    }else{
      if(B % 2 == 1){
         B--;
      }
      B = B / 2;
      A += B;
      turn = true;
    }
  }
  console.log(A + " " + B);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
