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) {
    int x = 0;
    for (int i = 0; i < a.length; i++) {
        if (i % 2 == 0) x += a[i];
        else x -= a[i];
    }
    auto b = [x/2];
    for (int i = 1; i < a.length; i++) {
        b ~= a[i-1] - b[$-1];
    }
    auto ans = b.map!(e => text(e * 2)).join(" ");
    writeln(ans);
}

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