n = int(eval(input()))

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

x =0

for i,w in enumerate(a):

    x += (-1)**i*w

ans = [x]

for i,t in enumerate(a):

    ans.append(int(((ans[i]/2)-t)*(-2)))

print((' '.join(map(str, ans[:-1]))))
n = int(eval(input()))

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

x =0

for i,w in enumerate(a):

    if i % 2:

        w*=-1

    x += w

ans = [x]

for i,t in enumerate(a[:-1]):

    ans.append(int(((ans[i]/2)-t)*(-2)))

print((' '.join(map(str, ans))))
n = int(eval(input()))
a = list(map(int, input().split()))
x = 0
for i, w in enumerate(a):
    x += (-1) ** i * w
ans = [x]
for i, t in enumerate(a):
    ans.append(int(((ans[i] / 2) - t) * (-2)))
print((" ".join(map(str, ans[:-1]))))

n = int(eval(input()))
a = list(map(int, input().split()))
x = 0
for i, w in enumerate(a):
    if i % 2:
        w *= -1
    x += w
ans = [x]
for i, t in enumerate(a[:-1]):
    ans.append(int(((ans[i] / 2) - t) * (-2)))
print((" ".join(map(str, ans))))

-    x += (-1) ** i * w +    if i % 2: +        w *= -1 +    x += w -for i, t in enumerate(a): +for i, t in enumerate(a[:-1]): -print((" ".join(map(str, ans[:-1])))) +print((" ".join(map(str, ans))))