import itertools



n = int(eval(input()))

a_list = list(map(int, input().split()))



xn = sum(a_list) // 2 - sum(a_list[:n-1:2])

x = a_list[-1] - xn

for a in a_list:

    print((x * 2))

    x = a - x
n = int(eval(input()))

a_list = list(map(int, input().split()))

x = sum(a_list[::2]) - sum(a_list) // 2

ans = []

for a in a_list:

    ans.append(str(x * 2))

    x = a - x

print((' '.join(ans)))
import itertools

n = int(eval(input()))
a_list = list(map(int, input().split()))
xn = sum(a_list) // 2 - sum(a_list[: n - 1 : 2])
x = a_list[-1] - xn
for a in a_list:
    print((x * 2))
    x = a - x

n = int(eval(input()))
a_list = list(map(int, input().split()))
x = sum(a_list[::2]) - sum(a_list) // 2
ans = []
for a in a_list:
    ans.append(str(x * 2))
    x = a - x
print((" ".join(ans)))

-import itertools - -xn = sum(a_list) // 2 - sum(a_list[: n - 1 : 2]) -x = a_list[-1] - xn +x = sum(a_list[::2]) - sum(a_list) // 2 +ans = [] -    print((x * 2)) +    ans.append(str(x * 2)) +print((" ".join(ans)))