INF = 1 << 60 N = int(input()) X = list(map(int, input().split())) Y = list(map(int, input().split())) hd = 0 tl = min([x+y for x, y in zip(X, Y)]) ans = [hd] for x, y in zip(X, Y): ans.append(min(x, tl)) ans.append(tl) print(tl) print(*ans, sep='\n')