let a, b, k = Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c
let ns = [|a; b|]
let _ = for i = 0 to k - 1 do let r = i mod 2 in ns.(1 - r) <- ns.(1 - r) + ns.(r) / 2; ns.(r) <- ns.(r) / 2 done;
  Printf.printf "%d %d\n" ns.(0) ns.(1)