#include <bits/stdc++.h>
using namespace std;
pair<int, pair<int, int> > domino[100005];
int ans[100005], dy[100005], n;
stack<int> gao;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &domino[i].first, &domino[i].second.first);
    domino[i].second.second = i;
  }
  sort(domino, domino + n);
  for (int i = 0; i < n; i++) ans[i] = 1;
  for (int i = n - 1; i >= 0; i--) {
    while (!gao.empty() && (domino[i].first + domino[i].second.first - 1) >=
                               domino[gao.top()].first)
      ans[i] += ans[gao.top()], gao.pop();
    gao.push(i);
  }
  for (int i = 0; i < n; i++) dy[domino[i].second.second] = ans[i];
  for (int i = 0; i < n; i++) {
    printf("%d", dy[i]);
    if (i != n - 1) printf(" ");
  }
}
