/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
int[] a = new int[n];
for(int i=0;i<n;i++){
a[i]= in.nextInt();
}
int S=0;
int i;
for(i=0;i<n;i++){
for(int j=0;j<n-i-1;j++){
S+=a[j];
}
a[n-i-1]=S;
S=0;
}
a[0]=a[1];
for( i=0;i<n;i++){
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewpwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb257CiAgICAgICAgICAgICBTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgIAkgICAgIGludCBuID0gaW4ubmV4dEludCgpOwogICAgICAgICAgICAgaW50W10gYSA9IG5ldyBpbnRbbl07CiAgICAgICAgICAgICBmb3IoaW50IGk9MDtpPG47aSsrKXsKICAgICAgICAgICAgICAgICAgYVtpXT0gaW4ubmV4dEludCgpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaW50IFM9MDsKICAgICAgICAgICAgIGludCBpOwogICAgICAgICAgICAgZm9yKGk9MDtpPG47aSsrKXsKICAgICAgICAgICAgICAgICAgZm9yKGludCBqPTA7ajxuLWktMTtqKyspewogICAgICAgICAgICAgICAgICAgICAgIFMrPWFbal07CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgYVtuLWktMV09UzsKICAgICAgICAgICAgICAgICAgUz0wOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgYVswXT1hWzFdOwogICAgICAgICAgICAgZm9yKCBpPTA7aTxuO2krKyl7CQogICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludChhW2ldKyIgIik7CiAgICAgICAgICAgICB9Cgl9Cn0=