#!/usr/bin/env PyPy3 from collections import Counter, defaultdict, deque import itertools import re import math from functools import reduce import operator import bisect from heapq import * import functools mod=998244353 import sys input=sys.stdin.readline n=int(input()) x=list(map(int,input().split())) a=list(map(int,input().split())) p = [i for i in range(n)] p.sort(key = lambda y:x[y]+a[y],reverse = True) ans = [-1] * n for pp in p: ans[pp] = x[pp] + a[pp] idx = bisect.bisect_right(x,x[pp] + a[pp]) if x[idx-1] == x[pp] + a[pp]: ans[pp] = max(ans[pp],ans[idx-1]) idx = bisect.bisect_right(x,x[pp] - a[pp]) if idx == 0: continue if x[idx-1] == x[pp] - a[pp]: ans[pp] = max(ans[pp],ans[idx-1]) for i in range(n): print(ans[i]-x[i])