#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
istream& operator>>(istream& in, pair<T1, T2>& p) {
  in >> p.first >> p.second;
  return in;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& p) {
  out << p.first << ' ' << p.second << '\n';
  return out;
}
template <class T>
istream& operator>>(istream& in, vector<T>& arr) {
  for (T& i : arr) in >> i;
  return in;
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& arr) {
  for (const T& i : arr) out << i << ' ';
  return out;
}
template <class T>
ostream& operator<<(ostream& out, const vector<vector<T>>& arr) {
  for (const vector<T>& i : arr) out << i << ' ' << '\n';
  return out;
}
struct One {
  int x, h, ind;
  One(){};
  One(int x_, int h_, int ind_) : x(x_), h(h_), ind(ind_) {}
  bool operator<(const One& o) const {
    if (x != o.x) {
      return x < o.x;
    }
    return ind < o.ind;
  }
};
int n;
vector<One> a;
vector<int> dr;
vector<int> sans;
vector<int> ans;
int solve(int i, int len) {
  int cur = i;
  for (cur = i + 1; cur < n; cur++) {
    if (a[cur].x > len) {
      return cur - 1;
    }
    if (a[sans[cur]].h + a[sans[cur]].x - 1 >= len) {
      return sans[cur];
    }
    cur = sans[cur];
  }
  return cur - 1;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  a.resize(n);
  dr.resize(n);
  sans.resize(n);
  ans.resize(n);
  for (int i = 0; i < n; i++) {
    int x, h;
    cin >> x >> h;
    One p = One(x, h, i);
    a[i] = p;
  }
  sort((a).begin(), (a).end());
  for (int i = n - 1; i >= 0; i--) {
    sans[i] = solve(i, a[i].x + a[i].h - 1);
    ans[a[i].ind] = sans[i] - i + 1;
  }
  cout << ans << '\n';
  return 0;
}
