#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int tree[N * 4];
void update(int node, int i, int j, int l, int r) {
  if (!(i <= l and l <= j)) return;
  if (i == j and j == l) {
    tree[node] = r;
    return;
  }
  if (i == j) return;
  int mid = i + j >> 1;
  update(node * 2, i, mid, l, r);
  update(node * 2 + 1, mid + 1, j, l, r);
  tree[node] = max(tree[node * 2], tree[node * 2 + 1]);
}
int query(int node, int i, int j, int l, int r) {
  if (i >= l and j <= r) return tree[node];
  if (i > r or j < l) return 0;
  int mid = i + j >> 1;
  int leftChild = query(node * 2, i, mid, l, r),
      rightChild = query(node * 2 + 1, mid + 1, j, l, r);
  return max(leftChild, rightChild);
}
int n, location[N], height[N];
vector<pair<int, int> > dominoes;
vector<pair<pair<int, int>, int> > dominoes_indexed;
int main() {
  cin >> n;
  dominoes.resize(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> location[i] >> height[i];
    dominoes_indexed.push_back({{location[i], height[i]}, i - 1});
  }
  sort(dominoes_indexed.begin(), dominoes_indexed.end());
  for (int i = 1; i <= n; i++)
    dominoes[i] = dominoes_indexed[i - 1].first,
    location[i] = dominoes[i].first, height[i] = dominoes[i].second;
  for (int i = 1; i <= n; i++) update(1, 1, n, i, i);
  vector<int> locs;
  for (int i = 1; i <= n; i++)
    locs.push_back(dominoes_indexed[i - 1].first.first);
  for (int i = n - 1; i > 0; i--) {
    int low = location[i];
    int high = max(low + 1, location[i] + height[i] - 1);
    int nxt_index = upper_bound(locs.begin(), locs.end(), high) - locs.begin();
    update(1, 1, n, i, query(1, 1, n, i, nxt_index));
  }
  int answers[n];
  for (int i = 1; i <= n; i++)
    answers[dominoes_indexed[i - 1].second] = query(1, 1, n, i, i) - i + 1;
  for (auto ans : answers) cout << ans << " ";
  return 0;
}
