#include <iostream>
#include <cstdio>
using namespace std;
const int N = 40000 + 10;
int n, a[N], b[N];
int main()
{
    freopen("sequence.in", "r", stdin);
    freopen("sequence.out", "w", stdout);
    cin >> n;
    for (int i = 1; i <= n; ++i)
        scanf("%d", &a[i]);
    b[0] = 0;
    b[1] = 0;
    b[2] = a[1];
    for (int i = 3; i <= n + 1; ++i)
        b[i] = a[i - 1] - a[i - 2] + b[i - 3];
    for (int i = 0; i <= n + 1; ++i)
        cout << b[i] << " ";
    return 0;
}
