fun solv(idx: Int, ab: Array<Int>): Array<Int>{
    val from = idx % 2
    val to = (idx + 1) % 2
    ab[to] += ab[from] / 2
    ab[from] /= 2
    return ab
}

fun main(args: Array<String>) {
    val (a,b,k) = readLine()!!.split(" ").map(String::toInt)
    var ab = arrayOf(a,b)
    for (i in 0 until k) {
        ab = solv(i,ab)
    }
    println(ab[0].toString() + " " + ab[1].toString())
}