import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
U = 2 * 10 ** 4 + 10


class FenwickTree(object):
    def __init__(self, n):
        self.n = n
        self.log = n.bit_length()
        self.data = [0] * n

    def __sum(self, r):
        s = 0
        while r > 0:
            s += self.data[r - 1]
            r -= r & -r
        return s

    def add(self, p, x):
        """ a[p] += xを行う"""
        p += 1
        while p <= self.n:
            self.data[p - 1] += x
            p += p & -p

    def sum(self, l, r):
        """a[l] + a[l+1] + .. + a[r-1]を返す"""
        return self.__sum(r) - self.__sum(l)

    def lower_bound(self, x):
        """a[0] + a[1] + .. a[i] >= x となる最小のiを返す"""
        if x <= 0:
            return -1
        i = 0
        k = 1 << self.log
        while k:
            if i + k <= self.n and self.data[i + k - 1] < x:
                x -= self.data[i + k - 1]
                i += k
            k >>= 1
        return i

    def __repr__(self):
        res = [self.sum(i, i+1) for i in range(self.n)]
        return " ".join(map(str, res))


def solve(N, X, Y):
    height = [0] * (U + 1)
    height[0] = U
    bit = FenwickTree(U+1)
    bit.add(0, 1)
    bit.add(U, 1)

    res = []

    for x, y in zip(X, Y):
        c = bit.sum(0, x)
        yr = height[bit.lower_bound(c + 1)]
        if yr >= y:
            res.append(0)
            continue

        point = c
        area = 0
        while point > 1:
            xl = bit.lower_bound(point)
            yl = height[xl]
            if yl > y:
                break

            xll = bit.lower_bound(point-1)
            area -= (xl - xll) * (yl - yr)
            point -= 1

        xl = bit.lower_bound(point)
        area += (x - xl) * (y - yr)

        res.append(area)
        height[x] = y
        bit.add(x, y)
    return res


N = int(input())
data = tuple(tuple(map(lambda x: abs(int(x)), input().split()))
             for _ in range(N))
x, y, xx, yy = zip(*data)

a1 = solve(N, x, y)
a2 = solve(N, x, yy)
a3 = solve(N, xx, y)
a4 = solve(N, xx, yy)
for i in range(N):
    print(a1[i] + a2[i] + a3[i] + a4[i])