Vasya is interested in arranging dominoes. He is fed up with common dominoes and he uses the dominoes of different heights. He put *n* dominoes on the table along one axis, going from left to right. Every domino stands perpendicular to that axis so that the axis passes through the center of its base. The *i*-th domino has the coordinate *x*<sub class="lower-index">*i*</sub> and the height *h*<sub class="lower-index">*i*</sub>. Now Vasya wants to learn for every domino, how many dominoes will fall if he pushes it to the right. Help him do that. 

Consider that a domino falls if it is touched strictly above the base. In other words, the fall of the domino with the initial coordinate *x* and height *h* leads to the fall of all dominoes on the segment [*x* + 1, *x* + *h* - 1].
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) which is the number of dominoes. Then follow *n* lines containing two integers *x*<sub class="lower-index">*i*</sub> and *h*<sub class="lower-index">*i*</sub> ( - 10<sup class="upper-index">8</sup> ≤ *x*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">8</sup>, 2 ≤ *h*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">8</sup>) each, which are the coordinate and height of every domino. No two dominoes stand on one point.
n = int(input())
dominos = []
for i in range(n):
    x, h = map(int, input().split())
    dominos.append((x, x + h - 1, i))

# Sort dominos by their left coordinate
dominos.sort()

stack = []
ans = [0] * n

# Loop through the sorted dominos
for domino in dominos:
    left, right, i = domino

    # Remove dominos from stack whose right coordinate is less than or equal to the current domino's left coordinate
    while stack and stack[-1][1] < left:
        stack.pop()

    # Count the number of falling dominos for the current domino
    cnt = len(stack)

    # Update the answer for all the dominos in the stack
    for _, _, j in stack:
        ans[j] = cnt

    # Add the current domino to the stack
    stack.append(domino)

# Update the answer for the last few dominos still in the stack
cnt = len(stack)
for _, _, j in stack:
    ans[j] = cnt

# Print the answer
print(*ans)
