#import <cstdio>
longint Input(){
char cha;
longint x=0;
while((cha=getchar_unlocked()))
if(cha!=' '&&cha!='\n')break;
x=cha-48;
while((cha=getchar_unlocked())){
if(cha==' '||cha=='\n')break;
x=x*10+cha-48;
}
if(x!=0||x==0)return x;
return EOF;
}
inline void write(int x){
if(x>9) write(x/10);
putchar_unlocked(x%10+'0');
}
int main()
{
int a;
while((a=Input())){
int b[a];
if(a!=1){
for(int i=a-1;i>=0;i--){
b[i]=Input();
b[i]*=i;
}
for(int i=a-1;i>0;i--){
write(b[i]), putchar_unlocked(32);
}
putchar_unlocked(10);
}
else{
b[0]=Input();
putchar_unlocked(48);
putchar_unlocked(10);
}
}
}