fun main(args: Array<String>) {
    tenka12018beginner_b()
}

fun tenka12018beginner_b() {
    var (a, b, k) = readLine()!!.split(' ').map { it.toLong() }

    var turnOfA = true
    while (k-- > 0) {
        if (turnOfA) {
            b += a / 2
            a /= 2
        } else {
            a += b / 2
            b /= 2
        }
        turnOfA = !turnOfA
    }

    val answer = "$a $b"

    println(answer)
}
