N = int(input()) X = list(map(int,input().split())) Y = list(map(int,input().split())) l = [X[i] + Y[i] for i in range(N)] M = max(l) print(M) print(0) for i in range(N): print(X[i]) print(M)