#include <bits/stdc++.h>
using namespace std;
int arr[100005][3];
int cnt[100005];
int arrcnt = 0;
int n;
void qs(int l, int r) {
  int i = l;
  int j = r;
  int x = arr[(i + j) >> 1][0];
  do {
    while (arr[i][0] < x) ++i;
    while (arr[j][0] > x) --j;
    if (i <= j) {
      swap(arr[i][0], arr[j][0]);
      swap(arr[i][1], arr[j][1]);
      swap(arr[i][2], arr[j][2]);
      ++i;
      --j;
    }
  } while (i <= j);
  if (i < r) qs(i, r);
  if (l < j) qs(l, j);
}
int findcnt(int v) {
  int res = 0;
  if (cnt[v] != 0) return cnt[v];
  for (int i = v + 1; (arr[i][0] <= arr[v][0] + arr[v][1] - 1) && (i < n);
       ++i) {
    if (cnt[i] == 0) {
      findcnt(i);
    }
    res += cnt[i];
    i += cnt[i] - 1;
  }
  ++res;
  cnt[v] = res;
  return res;
}
int find(int val) {
  int l = 0;
  int r = n - 1;
  while (l < r) {
    int x = (l + r) >> 1;
    if (arr[x][0] == val) return x;
    if (arr[x][0] > val)
      r = x - 1;
    else
      l = x + 1;
  }
  if (arr[l][0] > val) --l;
  return l;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> arr[arrcnt][0];
    cin >> arr[arrcnt][1];
    arr[arrcnt][2] = i;
    ++arrcnt;
  }
  qs(0, n - 1);
  for (int k = 0; k < n; ++k) {
    findcnt(k);
  }
  for (int k = 0; k < n; ++k) {
    arr[k][0] = arr[k][2];
    arr[k][2] = k;
  }
  qs(0, n - 1);
  for (int k = 0; k < n; ++k) {
    cout << cnt[arr[k][2]] << " ";
  }
  return 0;
}
