let a, b, k = Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c
let rec f i (a, b) = if i >= k then a, b else f (i + 1) @@ if i mod 2 = 0 then a / 2, b + a / 2 else a + b / 2, b / 2
let x, y = f 0 (a, b)
let _ = Printf.printf "%d %d\n" x y