INF = 1 << 60 n = int(input()) x = list(map(int, input().split())) a = list(map(int, input().split())) s = set() for i in range(n): s.add(x[i]) s.add(x[i] - a[i]) s.add(x[i] + a[i]) xs = sorted(list(s)) idx = {} for i in range(len(xs)): idx[xs[i]] = i g = [[] for _ in range(len(xs))] deg = [0 for _ in range(len(xs))] for i in range(n): v = idx[x[i]] u = idx[x[i] - a[i]] w = idx[x[i] + a[i]] g[w].append(v) g[u].append(v) deg[v] += 1 deg[v] += 1 dist = [INF for _ in range(len(xs))] par = [None for _ in range(len(xs))] st = [] for v in range(len(xs)): if deg[v] == 0: dist[v] = 0 par[v] = v st.append(v) while len(st) > 0: cur = st.pop() for nxt in g[cur]: if not par[nxt] is None: continue par[nxt] = par[cur] dist[nxt] = xs[par[nxt]] - xs[nxt] st.append(nxt) for i in range(n): print(dist[idx[x[i]]])