import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) X=[int(i) for i in input().split()] Y=[int(i) for i in input().split()] ans=10**7 for i in range(n): ans=min(ans,X[i]+Y[i]) print(ans) print(0) for i in range(n): print(max(min(X[i],ans-Y[i]),0)) print(ans)