N = int(input()) X = list(map(int, input().split())) Y = list(map(int, input().split())) s = float('inf') for x, y in zip(X, Y): s = min(s, x + y) print(s) print(0) for i in range(N): print(max(0, s - Y[i])) print(s)