#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
pair<int, pair<int, int> > p[maxn];
int xx[maxn], dp[maxn], seg[maxn * 4];
void update(int v, int l, int r, int x, int val) {
  if (r - l == 1) {
    seg[v] = val;
    return;
  }
  int mid = (l + r) / 2;
  if (x < mid)
    update(v * 2, l, mid, x, val);
  else
    update(v * 2 + 1, mid, r, x, val);
  seg[v] = max(seg[v * 2], seg[v * 2 + 1]);
}
int getmax(int v, int l, int r, int b, int e) {
  if (e <= l || r <= b) return -1e9;
  if (b <= l && r <= e) return seg[v];
  int mid = (l + r) / 2;
  return max(getmax(v * 2, l, mid, b, e), getmax(v * 2 + 1, mid, r, b, e));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> p[i].first >> p[i].second.first, p[i].second.second = i;
  sort(p, p + n);
  for (int i = 0; i < n; i++) xx[i] = p[i].first;
  dp[n - 1] = n - 1;
  update(1, 0, n, n - 1, dp[n - 1]);
  for (int i = n - 2; i >= 0; i--) {
    int right = lower_bound(xx, xx + n, p[i].second.first + p[i].first) - xx;
    dp[i] = max(i, getmax(1, 0, n, i, right));
    update(1, 0, n, i, dp[i]);
  }
  for (int i = 0; i < n; i++) p[p[i].second.second].first = dp[i] - i + 1;
  for (int i = 0; i < n; i++) cout << p[i].first << ' ';
  cout << '\n';
  return 0;
}
