#include <stdio.h>
#define N 300
int n, i, a[N], s[N], d[N], r[N], size;
void sum(int a[], int n)
{
	for (i=1; i <= n/2; ++i)
	{
		s[i]=a[2*i-1]+a[2*i];
	}
	return;
}
void dim(int a[], int n)
{
	for (i=1; i <= n/2; ++i)
	{
		d[i]=a[2*i-1]-a[2*i];
	}
	return;
}
void result(int s[], int d[], int n)
{
	for(i=1; i <= n; ++i)
	{
		if (i <= n/2)
			r[i]=s[i];
		else
			r[i]=d[i-n/2];
	}

}

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

	scanf ("%d", &n);
	size = n;
	for (i=1; i<=n; ++i)
	{
		scanf("%d", &a[i]);
	}
	sum(a, n);
	dim(a, n);
	result(s, d, n);
	while (n > 2)
	{
		n = n/2;
		for (i=1; i <= n; i++)
		{
			a[i] = r[i];
		}
		sum(a, n);
		dim(a, n);
		result(s, d, n);
	}
	for (i=1; i <= size; i++)
	{
		printf ("%d ", r[i]);
	}
	return 0;
}
