import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void calc(int[] a) {
    // x0 を求める(最初の山の雨量)
    int x0 = a.sum;
    for (int i = 1; i < a.length; i += 2) {
        x0 -= a[i] * 2;
    }

    // x0 が求まったので、残りは芋づる式に求める
    int[] xs = [x0];
    for (int i = 1; i < a.length; i++) {
        xs ~= 2 * a[i - 1] - xs[i - 1];
    }
    writeln(xs.map!(text).join(" "));
}

void main() {
    int n; scan(n);
    auto a = readints;
    calc(a);
}
