fun main(args:Array<String>){
  var (a, b, k) = readLine()!!.split(" ").map {it.toInt()}
  println(fmt(solve(a, b, 1, k)))
}

fun fmt(n: Pair<Int, Int>) : String {
  var (a, b) = n
  return Integer.toString(a) + " " + Integer.toString(b)
}

fun solve(a:Int, b:Int, n:Int, k:Int) : Pair<Int, Int> {
  if (n > k) {
    return Pair(a, b)
  }
  var (a1, b1) = if (n % 2 == 1) Pair(a / 2, a / 2 + b) else Pair(b / 2 + a, b / 2)
  return solve(a1, b1, n + 1, k)
}
