private fun readInts() = readLine()!!.split(" ").map { it.toInt() }.toList()

fun main(args: Array<String>) {
    var (A, B, K) = readInts()
    var count = 0

    while (true) {
        if (K <= count) break

        if (A % 2 != 0) A--
        B += A / 2
        A /= 2
        count++


        if (K <= count) break

        if (B % 2 != 0) B--
        A += B / 2
        B /= 2
        count++
    }

    println("$A $B")
}