N = int(input()) X = list(map(int,input().split())) A = list(map(int,input().split())) d = dict() for i,x in enumerate(X): d[x] = i G = [[] for _ in range(N)] for i in range(N): x = X[i] a = A[i] if x + a in d: G[d[x + a]].append(i) if x - a in d: G[d[x - a]].append(i) dp = [X[i] + A[i] for i in range(N)] top = [(X[i],A[i],i) for i in range(N)] top.sort(key = lambda x:x[0] + x[1],reverse = True) for x,a,i in top: for j in G[i]: if dp[i] > dp[j]: dp[j] = dp[i] for i in range(N): print(dp[i] - X[i])