N = int(input())

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



A = A + A



s1 = [0]

for i in range(N):

    s1.append((A[i] - s1[-1] // 2) * 2)



X = (s1[-1]) // 2

ans = [X]

for i in range(N):

    ans.append((A[i] - ans[-1] // 2) * 2)



print(*ans[:-1], sep=' ')

N = int(input())

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



dam_prob = 0

for i in range(N - 1):

    dam_prob = (A[i] - (dam_prob // 2)) * 2





start_dam = (A[-1] - (dam_prob // 2))

ans = [start_dam]

for i in range(N - 1):

    ans.append((A[i] - (ans[-1] // 2)) * 2)



print(*ans, sep=' ')

N = int(input())
A = list(map(int, input().split()))
A = A + A
s1 = [0]
for i in range(N):
    s1.append((A[i] - s1[-1] // 2) * 2)
X = (s1[-1]) // 2
ans = [X]
for i in range(N):
    ans.append((A[i] - ans[-1] // 2) * 2)
print(*ans[:-1], sep=" ")

N = int(input())
A = list(map(int, input().split()))
dam_prob = 0
for i in range(N - 1):
    dam_prob = (A[i] - (dam_prob // 2)) * 2
start_dam = A[-1] - (dam_prob // 2)
ans = [start_dam]
for i in range(N - 1):
    ans.append((A[i] - (ans[-1] // 2)) * 2)
print(*ans, sep=" ")

-A = A + A -s1 = [0] -for i in range(N): -    s1.append((A[i] - s1[-1] // 2) * 2) -X = (s1[-1]) // 2 -ans = [X] -for i in range(N): -    ans.append((A[i] - ans[-1] // 2) * 2) -print(*ans[:-1], sep=" ") +dam_prob = 0 +for i in range(N - 1): +    dam_prob = (A[i] - (dam_prob // 2)) * 2 +start_dam = A[-1] - (dam_prob // 2) +ans = [start_dam] +for i in range(N - 1): +    ans.append((A[i] - (ans[-1] // 2)) * 2) +print(*ans, sep=" ")