#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 10, MAX = 2e5 + 1e4, MOD = 1e9 + 7, MAXL = 25;
void OUT(long double o, int x) {
  cout << fixed << setprecision(x) << o;
  return;
}
pair<pair<long long, long long>, long long> a[MAX];
int bs(int s, int e, int x) {
  if (s == e) return s;
  int m = ((s + e) / 2) + 1;
  if (a[x].first.first + a[x].first.second < a[m].first.first)
    return bs(s, m - 1, x);
  return bs(m, e, x);
}
long long seg[4 * MAX], dp[MAX];
int g(int id, int b, int e, int l, int r) {
  if (r <= b || e <= l) return 0;
  if (l <= b && e <= r) return seg[id];
  int m = (b + e) / 2;
  return max(g(id * 2, b, m, l, r), g(id * 2 + 1, m, e, l, r));
}
void upd(int id, int b, int e, int x, int v) {
  if (e - b == 1) {
    seg[id] = v;
    return;
  }
  int m = (b + e) / 2;
  if (x < m)
    upd(id * 2, b, m, x, v);
  else
    upd(id * 2 + 1, m, e, x, v);
  seg[id] = max(seg[id * 2], seg[id * 2 + 1]);
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first.first >> a[i].first.second;
    a[i].first.second--;
    a[i].second = i;
  }
  sort(a, a + n);
  dp[a[n - 1].second] = 1;
  upd(1, 0, n, n - 1, n - 1);
  for (int i = n - 2; i >= 0; i--) {
    if (a[i].first.first + a[i].first.second < a[i + 1].first.first)
      dp[a[i].second] = i;
    else
      dp[a[i].second] = g(1, 0, n, i + 1, bs(i + 1, n - 1, i) + 1);
    upd(1, 0, n, i, dp[a[i].second]);
    dp[a[i].second] = dp[a[i].second] - i + 1;
  }
  for (int i = 0; i < n; i++) cout << dp[i] << " ";
  return 0;
}
