#include <bits/stdc++.h>
using namespace std;
const int MaxN = 3e5 + 1;
struct TQuery {
  int id, L, R;
};
int N, res[MaxN];
int IT[MaxN << 2], F[MaxN];
TQuery Q[MaxN];
void Enter() {
  int x, h;
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> x >> h;
    Q[i].id = i;
    Q[i].L = x;
    Q[i].R = x + h - 1;
  }
}
void UnZip() {
  vector<int> Zip;
  for (int i = 1; i <= N; i++) {
    Zip.push_back(Q[i].L + 1);
    Zip.push_back(Q[i].L);
    Zip.push_back(Q[i].R);
  }
  sort(Zip.begin(), Zip.end());
  Zip.resize(distance(Zip.begin(), unique(Zip.begin(), Zip.end())));
  for (int i = 1; i <= N; i++) {
    Q[i].L = lower_bound(Zip.begin(), Zip.end(), Q[i].L) - Zip.begin() + 1;
    Q[i].R = lower_bound(Zip.begin(), Zip.end(), Q[i].R) - Zip.begin() + 1;
  }
}
void Modify(int node, int L, int R, int pos, int val) {
  if (L == R) {
    IT[node] = val;
    return;
  }
  int mid = (L + R) >> 1;
  if (mid < pos) Modify(node << 1 | 1, mid + 1, R, pos, val);
  if (mid > pos - 1) Modify(node << 1, L, mid, pos, val);
  IT[node] = max(IT[node << 1], IT[node << 1 | 1]);
}
int Request(int node, int L, int R, int _L, int _R) {
  if (_L <= L && R <= _R) return IT[node];
  int mid = (L + R) >> 1;
  if (mid < _L) return Request(node << 1 | 1, mid + 1, R, _L, _R);
  if (mid > _R - 1) return Request(node << 1, L, mid, _L, _R);
  return max(Request(node << 1, L, mid, _L, _R),
             Request(node << 1 | 1, mid + 1, R, _L, _R));
}
bool operator<(TQuery a, TQuery b) { return a.L < b.L; }
void Solve() {
  sort(Q + 1, Q + N + 1);
  for (int i = 1; i <= N; i++) F[Q[i].L]++;
  for (int i = 1; i <= 3 * N; i++) F[i] += F[i - 1];
  for (int i = N; i >= 1; i--) {
    int ans = max(Q[i].R, Request(1, 1, 3 * N, Q[i].L + 1, Q[i].R));
    Modify(1, 1, 3 * N, Q[i].L, ans);
    res[Q[i].id] = F[ans] - F[Q[i].L - 1];
  }
  for (int i = 1; i <= N; i++) cout << res[i] << " ";
}
int main() {
  ios::sync_with_stdio(0);
  Enter();
  UnZip();
  Solve();
  return 0;
}
