#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;


int n, i, j, k, c=0, g;

int m[300];
int m1[300];
int m2[300];
int a, b;



int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

	// 8 39 -15 2 -3 3 1 -2 -3

	cin >> n;
	for(i=1;i<=n;i++)
		cin >> m[i];


	for(k=2; k<=n; k*=2)
	{
		for(i=1, j=1; i<k; i+=2, j++)
		{
			m1[i]=(m[j]+m[j+k/2])/2;
			m1[i+1]=m[j]-m1[i];
		}

		for(i=1; i<=k;i++)
			m[i]=m1[i];
	}



	for(i=1;i<=n;i++)
	{
		cout << m[i] << ' ';
	}



	return 0;
}