function main(arg) {
    arg = arg.split("\n")[0]
    arg = arg.split(" ")
    
    var a = Number(arg[0])
    var b = Number(arg[1])
    var k = Number(arg[2])
    
    for (var i = 0; i < k; i++) {
        if (i%2 === 0) {
            //takahashi
            if (a%2 === 1) {
                a--;
            }
            a /= 2
            b += a;
            
        } else {
            //aoki
            if (b%2 === 1) {
                b--;
            }
            b /= 2
            a += b;
        }
    }
    console.log(a +" "+ b)
    
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));