#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5 + 9;
long long n, dp[N], ans[N];
pair<long long, pair<long long, long long> > d[N];
pair<long long, long long> r[N][20];
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++)
    cin >> d[i].first >> d[i].second.first, d[i].second.second = i;
  sort(d, d + n);
  for (long long i = 0; i < n; i++)
    r[i][0].first = d[i].first + d[i].second.first - 1, r[i][0].second = i;
  for (long long i = 1; i <= 18; i++)
    for (long long j = 0; j < n; j++)
      r[j][i] = max(r[j][i - 1], r[j + (1 << (i - 1))][i - 1]);
  for (long long i = n - 1; i >= 0; i--) {
    long long l = 0, y = -1;
    long long t =
        (long long)(lower_bound(d, d + n,
                                pair<long long, pair<long long, long long> >(
                                    d[i].first + d[i].second.first - 1,
                                    pair<long long, long long>(1e10, 0))) -
                    d) -
        i - 1;
    if (!t)
      dp[i] = 0;
    else {
      while ((1 << l) <= t) l++;
      l--;
      y = max(r[i + 1][l], r[i + 1 + t - (1 << l)][l]).second;
      dp[i] = dp[y] + (y - i);
    }
  }
  for (long long i = 0; i < n; i++) ans[d[i].second.second] = dp[i] + 1;
  for (long long i = 0; i < n; i++) cout << ans[i] << ' ';
}
