#include <bits/stdc++.h>
using namespace std;
vector<pair<pair<long long, long long>, int> > in;
vector<int> out;
int t[300000], n;
long long last(int i) { return in[i].first.first + in[i].first.second; }
void build(int p = 1, int x = 0, int y = n - 1) {
  if (x == y) {
    t[p] = x;
    return;
  }
  build(2 * p, x, (x + y) / 2);
  build(2 * p + 1, 1 + (x + y) / 2, y);
  if (last(t[2 * p]) <= last(t[2 * p + 1]))
    t[p] = t[2 * p + 1];
  else
    t[p] = t[2 * p];
  return;
}
int query(int l, int r, int p = 1, int x = 0, int y = n - 1) {
  if (r < x || y < l) {
    return -1;
  }
  if (x >= l && y <= r) {
    return t[p];
  }
  int a = query(l, r, 2 * p, x, (x + y) / 2);
  int b = query(l, r, 2 * p + 1, 1 + (x + y) / 2, y);
  if (a == -1) return b;
  if (b == -1) return a;
  if (last(a) <= last(b))
    return b;
  else
    return a;
}
int bs(int x, int y, int a) {
  int m = (x + y) / 2;
  if (x == y) return x;
  if (in[m].first.first < a)
    return bs(m + 1, y, a);
  else
    return bs(x, m, a);
}
int fun(int u) {
  if (out[u]) return out[u];
  if (last(u) > in[n - 1].first.first) {
    return out[u] = n - u;
  }
  int a = bs(0, n - 1, last(u)) - 1;
  if (u == a) return out[u] = 1;
  int b = query(u, a);
  if (b == u) return out[u] = a - u + 1;
  out[u] += b - u;
  out[u] += fun(b);
  return out[u];
}
int main() {
  cin >> n;
  in.clear();
  in.resize(n);
  out.clear();
  out.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> in[i].first.first >> in[i].first.second;
    in[i].second = i;
  }
  sort(in.begin(), in.end());
  build();
  for (int i = 0; i < n; ++i) {
    if (out[i] == 0) fun(i);
  }
  vector<int> tmp(n);
  for (int i = 0; i < n; ++i) {
    tmp[in[i].second] = out[i];
  }
  for (int i = 0; i < n; ++i) {
    cout << tmp[i] << " ";
  }
  return 0;
}
