import scala.io.StdIn._

object Main{
  def solve(a : Int, b : Int, n : Int):(Int, Int) = {
    var ansA = a
    var ansB = b
    for(i <- 1 to n){
      if((i & 1) == 0){
        ansB /= 2
        ansA += ansB
      }
      else{
        ansA /= 2
        ansB += ansA
      }
    }
    (ansA, ansB)
  }

  def main(arg : Array[String]){
    val input = readLine().split(" ").map(_.toInt)
    val (a, b) : (Int, Int) = solve(input(0), input(1), input(2))
    println(f"$a $b")
  }
}
