#include <bits/stdc++.h>
using namespace std;
struct re {
  int x, h, id;
  bool operator()(const re &a, const re &b) { return a.x < b.x; }
} p[200001];
int n;
int Ans[200001], R[200001], ans, f[200001];
int C[1000001];
void calc(int x, int &Ans) {
  int l = 1, r = n;
  Ans = l;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (p[mid].x <= x) {
      if (mid > Ans) Ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
}
void add(int p, int l, int r, int x, int y) {
  if (l == r) {
    C[p] = y;
    return;
  }
  int mid = (l + r) >> 1, ll = p << 1;
  if (x <= mid)
    add(ll, l, mid, x, y);
  else
    add(ll + 1, mid + 1, r, x, y);
  C[p] = C[ll] > C[ll + 1] ? C[ll] : C[ll + 1];
}
void query(int p, int l, int r, int x, int y) {
  if (l == x && r == y) {
    if (C[p] > ans) ans = C[p];
    return;
  }
  int mid = (l + r) >> 1, ll = p << 1;
  if (y <= mid)
    query(ll, l, mid, x, y);
  else if (x >= mid + 1)
    query(ll + 1, mid + 1, r, x, y);
  else {
    query(ll, l, mid, x, mid);
    query(ll + 1, mid + 1, r, mid + 1, y);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &p[i].x, &p[i].h), p[i].id = i;
  sort(p + 1, p + 1 + n, re());
  for (int i = 1; i <= n; i++) calc(p[i].x + p[i].h - 1, R[i]);
  for (int i = n; i; i--) {
    ans = 0;
    query(1, 1, n, i, R[i]);
    Ans[i] = ans > i ? ans : i;
    add(1, 1, n, i, Ans[i]);
  }
  for (int i = 1; i <= n; i++) f[p[i].id] = Ans[i] - i + 1;
  for (int i = 1; i < n; i++) printf("%d ", f[i]);
  printf("%d\n", f[n]);
}
