#include <bits/stdc++.h>
using namespace std;
int N;
pair<pair<int, int>, int> duo[100009];
int f[100009];
stack<pair<int, int> > st;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%d%d", &duo[i].first.first, &duo[i].first.second);
    duo[i].second = i;
  }
  sort(duo + 1, duo + 1 + N);
  for (int i = N; i >= 1; i--) {
    int to = duo[i].first.second + duo[i].first.first, nxt = i + 1;
    while (!st.empty() && to > duo[st.top().first].first.first) {
      nxt = st.top().second;
      st.pop();
    }
    st.push(make_pair(i, nxt));
    f[duo[i].second] = nxt - i;
  }
  for (int i = 1; i <= N; i++) {
    printf("%d", f[i]);
    (i == N) ? printf("\n") : printf(" ");
  }
  return 0;
}
