#include <bits/stdc++.h>
int IntMaxVal = (int)1e20;
int IntMinVal = (int)-1e20;
long long LongMaxVal = (long long)1e20;
long long LongMinVal = (long long)-1e20;
using namespace std;
template <typename T>
struct argument_type;
template <typename T, typename U>
struct argument_type<T(U)> {};
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& s) {
  is >> s.first >> s.second;
  return is;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  ;
  vector<pair<pair<int, int>, int> > dominos(n);
  for (int i = 0; i < n; ++i) {
    dominos[i].second = i;
    cin >> dominos[i].first.first >> dominos[i].first.second;
  }
  sort(dominos.begin(), dominos.end());
  vector<int> ans(n);
  deque<pair<int, int> > standing;
  for (int i = n - 1; i >= 0; --i) {
    int x = dominos[i].first.first;
    int h = dominos[i].first.second;
    standing.push_front(make_pair(x, 1));
    while (standing.size() > 1 && standing[0].first + h > standing[1].first) {
      standing[0].second += standing[1].second;
      swap(standing[0], standing[1]);
      standing.pop_front();
    }
    ans[dominos[i].second] = standing.front().second;
  }
  for (auto x : ans) cout << x << ' ';
}
