object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val A, B, K = sc.nextInt()
  val (a, b) = 1.to(K).foldLeft(A -> B) {
    case ((a, b), i) =>
      if (i % 2 != 0) {
        (a / 2, b + a / 2)
      } else {
        (a + b / 2, b / 2)
      }
  }
  println(s"$a $b")
}
