#define loop(i,a,b) for(int i=a; i<b; ++i)
#define min(a,b) (a)<(b)?a:b;
#define max(a,b) (a)>(b)?a:b;
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int n, a[10000];

void trans( int k )
{
	vector <int> v;
	if ( k > n )
		k = n;
	loop(i,0,k/2)
	{
		v.push_back( ( a[i] + a[ i + k/2 ] ) / 2 );
		v.push_back( ( a[i] - a[ i + k/2 ] ) / 2 );
	}
	loop(i,0,v.size())
		a[i]=v[i];

	if ( k < n )
		trans( 2 * k );
}

int main()
{
	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	scanf("%d", &n);

	loop(i,0,n)
		scanf("%d", &a[i]);

	trans(2);


	loop(i,0,n)
		printf("%d ", a[i]);
	printf("\n");
	return 0;
}