import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!long).array;

    auto tmp = 0;
    foreach (i; 0..N) {
        tmp += i % 2 ? -A[i] : A[i];
    }

    auto ans = new long[](N);
    ans[0] = tmp;

    foreach (i; 1..N) {
        ans[i] = (A[i-1] - ans[i-1] / 2) * 2;
    }

    ans.map!(to!string).join(" ").writeln;
}