#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int a[300];
int s[300];
int N;

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

	int i, j;
	int cn;

	scanf("%d", &N);

	for (i = 0; i < N; i++)
		scanf("%d", a + i);

	cn = 1;

	while (cn < N)
	{
		memcpy(s, a, sizeof(s));

		for (i = 0; i < cn; i++)
		{
			a[2 * i] = (s[i] + s[i + cn]) / 2;
			a[2 * i + 1] = s[i] - a[2 * i];
		}

		cn *= 2;
	}

	for (i = 0; i < N; i++)
		printf("%d ", a[i]);

	puts("");

	return 0;
}