import collections import sys sys.setrecursionlimit(10**6) N = int(input()) X = list(map(int, input().split())) A = list(map(int, input().split())) L = collections.defaultdict(list) T = collections.defaultdict(int) G = [] for i in range(N): G.append(X[i]+A[i]) L[X[i]+A[i]].append(X[i]) L[X[i]-A[i]].append(X[i]) G.sort(reverse=True) def dfs(x,v): for l in L[x]: if T[l]==0: T[l]=v dfs(l,v) for g in G: if T[g]==0: T[g]=g dfs(g,g) for x in X: print(T[x]-x)