object Main extends App {
  val (a, b, k) = readLine.split(" ").map(_.toInt) match {
    case Array(a, b, k) => (a, b, k)
  }

  case class State(t: Int, a: Int, isTakahashi: Boolean) {
    def next = {
      if (isTakahashi) State(t / 2, a + t / 2, false) else State(t + a / 2, a / 2, true)
    }
  }

  val res = (1 to k).foldLeft(State(a, b, true))((acc, _) => acc.next)
  println(res.t + " " + res.a)
}