#include <bits/stdc++.h>
using namespace std;
long long int dx[] = {1, -1, 1, -1};
long long int dy[] = {1, 1, -1, -1};
long double PI = acosl(-1);
int tr[4 * 200005];
void build(int u, int b, int e) {
  if (b == e) {
    tr[u] = 0;
    return;
  }
  long long int mid = (b + e) / 2;
  build(2 * u, b, mid);
  build(2 * u + 1, mid + 1, e);
  tr[u] = max(tr[(2 * u)], tr[(2 * u) + 1]);
}
int quary(int u, int b, int e, int i, int j) {
  if (e < i or b > j)
    return 0;
  else if (b >= i and e <= j) {
    return tr[u];
  }
  int mid = (b + e) / 2;
  int left = quary(2 * u, b, mid, i, j);
  int right = quary((2 * u) + 1, mid + 1, e, i, j);
  return max(left, right);
}
void update(int u, int b, int e, int i, int j, int x) {
  if (e < i or b > j)
    return;
  else if (b >= i and e <= j) {
    tr[u] = x;
    return;
  }
  int mid = (b + e) / 2;
  update(2 * u, b, mid, i, j, x);
  update((2 * u) + 1, mid + 1, e, i, j, x);
  tr[u] = max(tr[2 * u], tr[2 * u + 1]);
}
int i = 0, j = 0, c = 0, mx = 0, n = 0, w, d = 0, k = 0, s = 0, f = 0, sum = 0,
    mid, mmn, t = 0, m = 0, l = 0, r = 0, x = 0, y, u;
vector<pair<int, int> > v;
int a[200005];
vector<int> v1;
map<int, int> mn, mp;
void input() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &l);
    scanf("%d", &r);
    v.push_back({l, r});
    if (l < 0) {
      mn[-l] = i;
    } else {
      mp[l] = i;
    }
    v1.push_back(l);
  }
  sort(v1.begin(), v1.end());
}
void solve() {
  build(1, 0, n - 1);
  for (i = n - 1; i >= 0; i--) {
    int indx;
    if (v1[i] < 0)
      indx = mn[-v1[i]];
    else
      indx = mp[v1[i]];
    d = v[indx].first + v[indx].second - 1;
    l = lower_bound(v1.begin(), v1.end(), d) - v1.begin();
    if (l >= n or v1[l] != d) l--;
    d = quary(1, 0, n - 1, i, l);
    a[indx] = max(d, i) - i + 1;
    update(1, 0, n - 1, i, i, max(i, d));
  }
}
void print() {
  for (i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
}
void setall() {
  memset(tr, 0, sizeof(tr));
  v.clear();
  v1.clear();
  mn.clear();
  mp.clear();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  t = 1;
  while (t--) {
    input();
    solve();
    print();
    setall();
  }
  return 0;
}
