#include <iostream>
#include <stdio.h>
using namespace std;

int A[256];
int tmp[256];
int N;

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	cin >> N;
	for(int i=0;i<N;i++)
		cin >> A[i];
	int m=2;
	do
	{
		for(int i=0;i<m/2;i++)
		{
			tmp[2*i]=(A[i]+A[m/2+i])/2;
			tmp[2*i+1]=(A[i]-A[m/2+i])/2;
		}
		for(int i=0;i<m;i++)
			A[i]=tmp[i];
		m*=2;
	}
	while(m<=N);
	for(int i=0;i<N;i++)
		cout << A[i] << " ";
	return 0;
}