#include <bits/stdc++.h>
using namespace std;
int n;
const int mxn = (1e5) + 5;
pair<int, int> a[mxn];
pair<int, int> b[mxn];
int st[mxn * 4];
int dp[mxn];
map<int, int> ans;
int y;
void bs(int x, int i) {
  int l = i;
  int r = n - 1;
  while (l <= r) {
    int m = (l + r) / 2;
    if (a[m].first <= x) {
      y = m;
      l = m + 1;
    } else
      r = m - 1;
  }
}
void build(int p, int l, int r) {
  if (l == r) {
    st[p] = l;
    return;
  }
  int m = (l + r) / 2;
  build(p * 2, l, m);
  build(p * 2 + 1, m + 1, r);
  int x = a[st[p * 2]].first + a[st[p * 2]].second - 1;
  int y = a[st[p * 2 + 1]].first + a[st[p * 2 + 1]].second - 1;
  if (x >= y)
    st[p] = st[p * 2];
  else
    st[p] = st[p * 2 + 1];
}
int query(int p, int l, int r, int i, int j) {
  if (r < i || l > j) return -1;
  if (l >= i && r <= j) return st[p];
  int m = (l + r) / 2;
  int x = query(p * 2, l, m, i, j);
  int y = query(p * 2 + 1, m + 1, r, i, j);
  if (x == -1) return y;
  if (y == -1) return x;
  int xx = a[x].first + a[x].second - 1;
  int yy = a[y].first + a[y].second - 1;
  if (xx >= yy) return x;
  return y;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &b[i].first, &b[i].second);
    a[i] = b[i];
  }
  sort(a, a + n);
  build(1, 0, n - 1);
  for (int i = n - 1; i >= 0; --i) {
    bs(a[i].first + a[i].second - 1, i);
    if (y == i) {
      ans[a[i].first] = 1;
      dp[i] = 1;
      continue;
    }
    int in = query(1, 0, n - 1, i + 1, y);
    if (in == -1)
      ans[a[i].first] = 1, dp[i] = 1;
    else {
      dp[i] = dp[in] + (in - i);
      ans[a[i].first] = dp[i];
    }
  }
  for (int i = 0; i < n; ++i) printf("%d ", ans[b[i].first]);
  printf("\n");
  return 0;
}
