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