//#pragma comment(linker,"/STACK:12000")
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<time.h>s
#define eps 1e-15
using namespace std;
int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	int n, m, i, j, a[300][2]={0};
	bool f=1;
	scanf("%d", &n);
	m=1;
	for(i=1; i<=n; i++)
		scanf("%d", &a[i][0]);
	while(m<n)
	{
		for(i=1; i<=n; i++)
			a[i][f]=a[i][!f];
		for(j=1; j<=m; j++)
		{
			a[2*j-1][f]=(a[j][!f]+a[m+j][!f])/2;
			a[2*j][f]=(a[j][!f]-a[m+j][!f])/2;
		}
		f=!f;
		m*=2;
	}
	f=!f;
	for(i=1; i<=n; i++)
		printf("%d ", a[i][f]);
		
	return 0;
}