let a, b, k = Scanf.scanf " %d %d %d" @@ fun a b c -> ref a, ref b, c
let _ = for i = 1 to k do if i mod 2 = 1 then (a := !a / 2; b := !b + !a) else (b := !b / 2; a := !a + !b) done; Printf.printf "%d %d\n" !a !b