#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int64_t MOD = 1000000007;
const int INF = 0x3F3F3F3F;
const long long LINF = 4611686018427387903;
int64_t gcd(int64_t a, int64_t b) {
  if (b == 0) return a;
  a %= b;
  return gcd(b, a);
}
template <typename _Size>
inline _Size __lg(_Size __n) {
  _Size __k;
  for (__k = 0; __n != 0; __n >>= 1) ++__k;
  return __k - 1;
}
const int N = 100025;
struct node {
  int x, h, id;
};
bool cmp(node a, node b) { return a.x < b.x; }
vector<node> arr;
int dp[N];
int lc[N * 40], rc[N * 40];
int cnt;
struct segtree {
  int lazy[N * 40];
  int seg[N * 40];
  void push(int p) {
    if (lazy[p]) {
      seg[lc[p]] += lazy[p];
      lazy[lc[p]] += lazy[p];
      seg[rc[p]] += lazy[p];
      lazy[rc[p]] += lazy[p];
      lazy[p] = 0;
    }
  }
  void pull(int p) { seg[p] = max(seg[lc[p]], seg[rc[p]]); }
  void modify(int rt, int l, int r, int ql, int qr, int x) {
    if (ql <= l && qr >= r) {
      seg[rt] += x;
      lazy[rt] += x;
      return;
    }
    if (!lc[rt]) lc[rt] = ++cnt;
    if (!rc[rt]) rc[rt] = ++cnt;
    push(rt);
    int mid = l + r >> 1;
    if (ql <= mid) modify(lc[rt], l, mid, ql, qr, x);
    if (qr > mid) modify(rc[rt], mid + 1, r, ql, qr, x);
    pull(rt);
  }
  int query(int rt, int l, int r, int ql, int qr) {
    if (ql <= l && qr >= r) return seg[rt];
    if (!lc[rt]) lc[rt] = ++cnt;
    if (!rc[rt]) rc[rt] = ++cnt;
    push(rt);
    int tmp = -INF;
    int mid = l + r >> 1;
    if (ql <= mid) tmp = max(tmp, query(lc[rt], l, mid, ql, qr));
    if (qr > mid) tmp = max(tmp, query(rc[rt], mid + 1, r, ql, qr));
    return tmp;
  }
} sgt;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  cnt = 1;
  arr.resize(n + 1);
  arr[0].x = -INF;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i].x;
    cin >> arr[i].h;
    arr[i].id = i;
  }
  sort(arr.begin(), arr.end(), cmp);
  for (int i = n; i; i--) {
    sgt.modify(1, -(int)1e8, (int)1e8, arr[i].x, (int)1e8, 1);
    dp[arr[i].id] = sgt.query(1, -(int)1e8, int(1e8), arr[i].x,
                              min((int)1e8, arr[i].x + arr[i].h - 1));
    sgt.modify(1, -(int)1e8, (int)1e8, arr[i].x, arr[i].x, dp[arr[i].id] - 1);
  }
  for (int i = 1; i <= n; i++) cout << dp[i] << " ";
  return 0;
}
