#include<iostream>
#include<math.h>
#include<iomanip>
#include<string>
#include<algorithm>
#include<map>
#include<stack>
#include<deque>
#include<cstdio>
#include<queue>
#include<fstream>
using namespace std;
int main() {
ifstream cin("sequence.in");
ofstream cout("sequence.out");
int n,a[100000],b[100000],i,j,z,x;
cin>>n;
for(i=1;i<=n;i++) {
cin>>a[i];
}
b[0]=a[1];b[1]=0;b[2]=0;
for(i=2;i<=n;i++) {
b[i+1]=a[i]-b[i]-b[i-1];
}
for(i=0;i<=n+1;i++) {
cout<<b[i]<<" ";
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPG1hdGguaD4KI2luY2x1ZGU8aW9tYW5pcD4KI2luY2x1ZGU8c3RyaW5nPgojaW5jbHVkZTxhbGdvcml0aG0+CiNpbmNsdWRlPG1hcD4KI2luY2x1ZGU8c3RhY2s+CiNpbmNsdWRlPGRlcXVlPgojaW5jbHVkZTxjc3RkaW8+CiNpbmNsdWRlPHF1ZXVlPgojaW5jbHVkZTxmc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKIGlmc3RyZWFtIGNpbigic2VxdWVuY2UuaW4iKTsKIG9mc3RyZWFtIGNvdXQoInNlcXVlbmNlLm91dCIpOwogaW50IG4sYVsxMDAwMDBdLGJbMTAwMDAwXSxpLGoseix4OwogY2luPj5uOwogZm9yKGk9MTtpPD1uO2krKykgewogIGNpbj4+YVtpXTsKIH0KIGJbMF09YVsxXTtiWzFdPTA7YlsyXT0wOwogZm9yKGk9MjtpPD1uO2krKykgewogIGJbaSsxXT1hW2ldLWJbaV0tYltpLTFdOwogfQogZm9yKGk9MDtpPD1uKzE7aSsrKSB7CiAgY291dDw8YltpXTw8IiAiOwogfQogcmV0dXJuIDA7Cn0=