#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
pair<pair<int, int>, int> arr[100009];
int ans[100009], s[100009 << 2];
set<pair<int, int> > t;
int tap(int l, int r, int nd, int x, int y) {
  if (l > y or x > r) return 0;
  if (l <= x and y <= r) return s[nd];
  int mid = (x + y) >> 1;
  return max(tap(l, r, nd * 2, x, mid), tap(l, r, nd * 2 + 1, mid + 1, y));
}
void upd(int p, int v, int nd, int x, int y) {
  if (x == y) {
    umax(s[nd], v);
    return;
  }
  int mid = (x + y) >> 1;
  if (p <= mid)
    upd(p, v, nd * 2, x, mid);
  else
    upd(p, v, nd * 2 + 1, mid + 1, y);
  s[nd] = max(s[nd * 2], s[nd * 2 + 1]);
}
int main() {
  int a;
  cin >> a;
  for (int i = 1; i <= a; i++)
    scanf("%d%d", &arr[i].first.first, &arr[i].first.second), arr[i].second = i;
  int c = 0;
  sort(arr + 1, arr + a + 1);
  for (int i = 1; i <= a; i++) t.insert(make_pair(arr[i].first.first, i));
  for (int i = a; i >= 1; i--) {
    int l = arr[i].first.first, r = arr[i].first.second, ind = arr[i].second;
    pair<int, int> k = *(--t.upper_bound(make_pair(l + r - 1, 1000000007)));
    ans[ind] = max(tap(i, k.second, 1, 1, a), i);
    upd(i, ans[ind], 1, 1, a);
    ans[ind] = ans[ind] - i + 1;
  }
  for (int i = 1; i <= a; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
