#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
long long n, t, x, y, sum;
long long a[N], ans[N], ind[N];
vector<pair<long long, long long> > v, tmp;
vector<long long> b;
map<pair<long long, long long>, long long> m;
void read_input() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> x >> y;
    tmp.push_back({x, y});
    v.push_back({x, y});
    m[{x, y}] = i;
  }
  sort(v.begin(), v.end());
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  read_input();
  b.push_back(v.size() - 1);
  ans[v.size() - 1] = 1;
  for (long long i = v.size() - 2; i >= 0; i--) {
    if (v[i].first + v[i].second > v[b.back()].first) {
      ans[i]++;
      while (b.size() && (v[i].first + v[i].second > v[b.back()].first)) {
        ans[i] += ans[b.back()];
        b.pop_back();
      }
      b.push_back(i);
    } else {
      ans[i] = 1;
      b.push_back(i);
    }
  }
  for (long long i = 0; i < n; i++) {
    m[{v[i].first, v[i].second}] = ans[i];
  }
  for (long long i = 0; i < tmp.size(); i++) {
    cout << m[{tmp[i].first, tmp[i].second}] << ' ';
  }
  return 0;
}
