#include <iostream>

using namespace std;
int n,a[100005];

int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;++i)scanf("%d",a+i);
    int last = a[0];
    for(int i=1;i<n;++i)
    {
        last = a[i]-last;
    }
    printf("%d",last);
    for(int i=0;i<n-1;++i)
    {
        last = 2*(a[i] - last/2);
        printf(" %d",last);
    }
    printf("\n");
    return 0;
}
