let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let x = ref 0
let _ =
  for i = 0 to n - 1 do x := !x + a_s.(i) * if i mod 2 = 0 then 1 else -1 done;
  print_int !x;
  for i = 1 to n - 1 do x := 2 * (a_s.(i - 1) - !x / 2); Printf.printf " %d" !x done;
  print_newline ()