#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 5;
struct Domino {
  int pos, r, id;
};
Domino a[maxn];
int n, h, tail, q[maxn], f[maxn];
void init() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) {
    scanf("%d%d", &a[i].pos, &h);
    a[i].r = a[i].pos + h - 1;
    a[i].id = i;
  }
}
bool cmp_pos(const Domino& i, const Domino& j) { return i.pos > j.pos; }
void solve() {
  sort(a + 1, a + n + 1, cmp_pos);
  tail = 0;
  for (int i = (1); i <= (n); i++) {
    int now = -1;
    for (int j = (tail); j >= (1); j--)
      if (a[q[j]].pos <= a[i].r) {
        if (now == -1 || f[a[q[now]].id] - q[now] < f[a[q[j]].id] - q[j])
          now = j;
      } else
        break;
    if (now != -1)
      f[a[i].id] = f[a[q[now]].id] + (i - q[now]);
    else
      f[a[i].id] = 1;
    while (tail > 0 && a[q[tail]].pos <= a[i].r) --tail;
    ++tail;
    q[tail] = i;
  }
}
void print() {
  for (int i = (1); i <= (n); i++) printf("%d ", f[i]);
  printf("\n");
}
int main() {
  init();
  solve();
  print();
  return 0;
}
