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