#include <bits/stdc++.h>
using namespace std;
struct domino {
  long long first;
  long long second;
  long long q;
};
bool operator<(domino a, domino b) {
  if (a.first != b.first) return a.first < b.first;
  if (a.second != b.second) return a.second < b.second;
  return a.q < b.q;
}
domino a[1000000 + 5];
long long ans[1000000 + 5];
long long t[4000000 + 5];
long long psh[4000000 + 5];
inline void push(long long v, long long tl, long long tr) {
  if (psh[v] != 0) {
    t[v] += psh[v];
    if (tl != tr) {
      psh[v * 2] += psh[v];
      psh[v * 2 + 1] += psh[v];
    }
    psh[v] = 0;
  }
}
void update(long long v, long long tl, long long tr, long long l, long long r,
            long long q) {
  push(v, tl, tr);
  if (l > r) return;
  if (tl == l && tr == r) {
    psh[v] += q;
    push(v, tl, tr);
    return;
  }
  long long tm = (tl + tr) / 2;
  update(v * 2, tl, tm, l, min(r, tm), q);
  update(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r, q);
  t[v] = max(t[v * 2], t[v * 2 + 1]);
}
long long get_mx(long long v, long long tl, long long tr, long long l,
                 long long r) {
  push(v, tl, tr);
  if (l > r) return 0;
  if (tl == l && tr == r) {
    return t[v];
  }
  long long tm = (tl + tr) / 2;
  return max(get_mx(v * 2, tl, tm, l, min(r, tm)),
             get_mx(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
}
int32_t main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    a[i].q = i;
  }
  sort(a, a + n);
  for (long long i = n - 1; i >= 0; i--) {
    long long cur =
        lower_bound(a, a + n, domino{a[i].first + a[i].second - 1, 0, 0}) - a;
    if (cur == n) {
      cur--;
    } else {
      if (a[cur].first > a[i].first + a[i].second - 1) cur--;
    }
    ans[a[i].q] = get_mx(1, 0, n - 1, i, cur) + 1;
    update(1, 0, n - 1, i, i, ans[a[i].q]);
    update(1, 0, n - 1, i + 1, n - 1, 1);
  }
  for (long long i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
