#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, z, fen[300009], mx, dp[300009];
pair<long long, long long> p[300009], g[300009];
map<long long, long long> m, n;
map<long long, long long>::iterator it;
void upd(long long q, long long w) {
  while (q <= 300002) {
    if (fen[q] < w) fen[q] = w;
    q = q + (q & (-q));
  }
}
void read(long long q) {
  while (q >= 1) {
    if (mx < fen[q]) mx = fen[q];
    q = q - (q & (-q));
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> a;
  for (b = 1; b <= a; b++) {
    cin >> p[b].first >> p[b].second;
    g[b] = p[b];
    n[p[b].first] = 1;
    n[p[b].first + p[b].second - 1] = 1;
  }
  z = 1;
  for (it = n.begin(); it != n.end(); it++) {
    n[(*it).first] = z;
    z++;
  }
  sort(p + 1, p + a + 1);
  dp[a] = 1;
  upd(n[p[a].first], a);
  for (b = a - 1; b >= 1; b--) {
    mx = 0;
    read(n[p[b].first + p[b].second - 1]);
    if (mx != 0)
      dp[b] = mx - b + 1;
    else
      dp[b] = 1;
    if (mx != 0)
      upd(n[p[b].first], mx);
    else
      upd(n[p[b].first], b);
  }
  for (b = 1; b <= a; b++) {
    m[p[b].first] = dp[b];
  }
  for (b = 1; b <= a; b++) {
    cout << m[g[b].first] << " ";
  }
  return 0;
}
