N = int(input())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
mind = 10 ** 7
for i in range(N):
    mind = min(mind,X[i] + Y[i])
print(mind)
print(0)
for i in range(N):
    print(min(X[i],mind))
print(mind)