#include <bits/stdc++.h>
using namespace std;
int ni() {
  int a;
  scanf("%d", &a);
  return a;
}
double nf() {
  double a;
  scanf("%lf", &a);
  return a;
}
char sbuf[100005];
string ns() {
  scanf("%s", sbuf);
  return sbuf;
}
long long nll() {
  long long a;
  scanf("%lld", &a);
  return a;
}
template <class T>
void out(T a, T b) {
  bool first = true;
  for (T i = a; i != b; ++i) {
    if (!first) printf(" ");
    first = false;
    cout << *i;
  }
  printf("\n");
}
template <class T>
void outl(T a, T b) {
  for (T i = a; i != b; ++i) {
    cout << *i << "\n";
  }
}
int n, m;
int ans[100005];
int main() {
  int i, j, k;
  vector<pair<pair<int, int>, int> > v;
  n = ni();
  for (i = (0); i < (((n))); ++i) {
    int a = ni();
    int b = ni();
    v.push_back(make_pair(make_pair(a, b), i));
  }
  sort((v).begin(), (v).end());
  reverse((v).begin(), (v).end());
  vector<pair<int, int> > s;
  vector<int> sa;
  for (i = (0); i < (((v.size()))); ++i) {
    pair<int, int> last = make_pair(-1, -1);
    pair<int, int> vv = v[i].first;
    int aa = 1;
    while (s.size()) {
      if (s.back().first >= vv.first + vv.second)
        break;
      else {
        if (last.second == -1 || last.first + last.second <= s.back().first)
          aa += sa.back();
        if (vv.first + vv.second >= s.back().first + s.back().second) {
          last = s.back();
          s.pop_back();
          sa.pop_back();
        } else
          break;
      }
    }
    s.push_back(vv);
    sa.push_back(aa);
    ans[v[i].second] = aa;
  }
  out(ans, ans + n);
  return 0;
}
