N = int(input()) X = [int(x) for x in input().split()] Y = [int(y) for y in input().split()] maxd = 10**7 for i in range(N): maxd = min(maxd, X[i]+Y[i]) print(maxd) print(0) for i in range(N): if X[i] < maxd: print(X[i]) else: print(maxd) print(maxd)