#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
		freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	//cout.setf(ios::fixed | ios::showpoint);
	//cout.precision(2);
	long mass[256],m[256],n,i,j,k,a,b;
	cin>>n;
	for(i=0;i<n;i++) cin>>mass[i];
	for(i=1;i<=n/2;i*=2)
	{
		for(j=0;j<i;j++)
		{
			m[2*j]=(mass[j]+mass[j+i])/2;
			m[2*j+1]=mass[j]-m[2*j];
		}
		for(j=0;j<2*i;j++)mass[j]=m[j];
	}
	for(i=0;i<n;i++) cout<<mass[i]<<' ';
	cin>>i;
	return 0;
}