#include <bits/stdc++.h>
using namespace std;
struct Domino {
  int coordinate, height, input_index;
};
template <size_t Size>
class Segment_Tree {
 protected:
  array<int, 4 * Size> segment_tree;
  int ceil_log(const int &number) {
    int result = 0;
    for (int power_of_two = 1; power_of_two < number;
         power_of_two <<= 1, ++result)
      ;
    return result;
  }
  int leaf_to_index(const int &leaf) { return (1 << (height - 1)) - 1 + leaf; }
  int parent(const int &index) { return index / 2; }
  int left_child(const int &index) { return index * 2; }
  int right_child(const int &index) { return index * 2 + 1; }

 public:
  int height = ceil_log(Size) + 1;
  Segment_Tree() {
    for (int depth = 1; depth <= height; ++depth)
      for (int index = 1 << (depth - 1); index < 1 << depth; ++index)
        segment_tree[index] = 0;
  }
  void set(const int &leaf, const int &value) {
    segment_tree[leaf_to_index(leaf)] = value;
    for (int index = parent(leaf_to_index(leaf)); index >= 1;
         index = parent(index))
      segment_tree[index] = max(segment_tree[left_child(index)],
                                segment_tree[right_child(index)]);
  }
  int get(const int &start_leaf, const int &end_leaf) {
    int result = -1;
    int start_index, end_index;
    for (start_index = leaf_to_index(start_leaf),
        end_index = leaf_to_index(end_leaf);
         start_index < end_index;
         start_index = parent(start_index), end_index = parent(end_index)) {
      if (left_child(parent(start_index)) != start_index) {
        result = max(result, segment_tree[start_index]);
        ++start_index;
      }
      if (right_child(parent(end_index)) != end_index) {
        result = max(result, segment_tree[end_index]);
        --end_index;
      }
    }
    if (start_index == end_index)
      result = max(result, segment_tree[start_index]);
    return result;
  }
};
const int MAX_N = 1e5;
int n;
array<Domino, MAX_N + 1> dominos;
Segment_Tree<MAX_N> segment_tree;
bool has_next(const int &index) { return index < n; }
bool makes_next_to_fall(const int &index) {
  return dominos[index].coordinate + dominos[index].height - 1 >=
         dominos[index + 1].coordinate;
}
int farest_fallen_domino(const int &range_start, const int &range_end) {
  return segment_tree.get(range_start, range_end);
}
struct proxy {
  const int index;
  proxy(const int &index) : index(index) {}
  void operator=(const int &value) { segment_tree.set(index, value); }
  operator int() { return segment_tree.get(index, index); }
};
proxy farest_fallen_domino(const int &index) { return proxy(index); }
void optimize_IO() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
int main() {
  array<int, MAX_N + 1> z;
  optimize_IO();
  cin >> n;
  for (int input_index = 1; input_index <= n; ++input_index) {
    int x, h;
    cin >> x >> h;
    dominos[input_index] = {x, h, input_index};
  }
  sort(dominos.begin() + 1, dominos.begin() + n + 1,
       [](const Domino &comparand, const Domino &comparator) {
         return comparand.coordinate < comparator.coordinate;
       });
  for (int index = n; index >= 1; --index) {
    if (has_next(index) and makes_next_to_fall(index))
      farest_fallen_domino(index) = farest_fallen_domino(
          index + 1,
          distance(dominos.begin() + 1,
                   upper_bound(
                       dominos.begin() + 1, dominos.begin() + n + 1,
                       dominos[index].coordinate + dominos[index].height - 1,
                       [](const int &fallen_coordinate, const Domino &domino) {
                         return fallen_coordinate < domino.coordinate;
                       })));
    else
      farest_fallen_domino(index) = index;
  }
  for (int index = 1; index <= n; ++index)
    z[dominos[index].input_index] = farest_fallen_domino(index) - index + 1;
  for (int input_index = 1; input_index <= n; ++input_index)
    cout << z[input_index] << ' ';
  cout << '\n';
}
