#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int val[maxn];
int st[maxn][20];
int loga[maxn];
int n;
int max_idx(int i, int j) {
  if (val[i] > val[j]) return i;
  return j;
}
void build() {
  for (int i = 1; i <= n; i++) loga[i] = 31 - __builtin_clz(i);
  for (int i = 0; i < n; i++) {
    st[i][0] = i;
  }
  for (int i = 1; (1 << i) <= n; i++) {
    for (int j = 0; j + (1 << i) <= n; j++) {
      st[j][i] = max_idx(st[j][i - 1], st[j + (1 << (i - 1))][i - 1]);
    }
  }
}
int query(int l, int r) {
  if (l > r) swap(l, r);
  int len = (r - l + 1);
  return max_idx(st[l][loga[len]], st[r - (1 << loga[len]) + 1][loga[len]]);
}
pair<int, pair<int, int> > v[maxn];
int get_idx(int l, int value) {
  int lo = l;
  int hi = n - 1;
  int ans = 0;
  int vv = v[l].first + value;
  while (lo <= hi) {
    int mid = (lo + hi) >> 1;
    if (vv >= v[mid].first) {
      ans = mid;
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  return ans;
}
int ans[maxn];
int dp[maxn];
int main() {
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &v[i].first, &v[i].second.first);
    v[i].second.second = i;
  }
  sort(v, v + n);
  for (int i = 0; i < n; i++) {
    val[i] = v[i].first + v[i].second.first - 1;
  }
  build();
  for (int i = n - 1; i >= 0; i--) {
    int idx = get_idx(i, v[i].second.first - 1);
    int idx1 = query(i, idx);
    if (idx1 == i)
      dp[i] = idx - i + 1;
    else
      dp[i] = dp[idx1] + idx1 - i;
    ans[v[i].second.second] = dp[i];
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", ans[i]);
  }
  puts("");
  return 0;
}
