N = int(input()) lsX = list(map(int,input().split())) lsY = list(map(int,input().split())) minXY = float('INF') for i in range(N): minXY = min(minXY,lsX[i]+lsY[i]) print(minXY) print(0) for i in range(N): if minXY <= lsY[i]: print(0) elif minXY <= lsX[i]: print(minXY) else: print(lsX[i]) print(minXY)