#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline long long int rand(long long int x, long long int y) {
  ++y;
  return (rng() % (y - x)) + x;
}
long long int n, l, r;
struct node {
  long long int second, e, m, v;
  bool add, merged;
  node *l, *r;
  node(long long int _s, long long int _e) {
    second = _s, e = _e, m = (second + e) / 2, v = 0;
    add = 0;
    merged = 0;
    if (second != e) {
      l = new node(second, m);
      r = new node(m + 1, e);
    }
  }
  void update(long long int x, long long int y) {
    if (second == x && e == y) {
      add = 1;
      v = 1;
      return;
    }
    if (x > m)
      r->update(x, y);
    else if (y <= m)
      l->update(x, y);
    else {
      l->update(x, m), r->update(m + 1, y);
      merged = 1;
    }
    l->value();
    r->value();
    if (!add)
      v = l->v + r->v - merged;
    else
      v = 1;
  }
  long long int value() {
    if (add) v = 1;
    if (second != e) {
      l->add |= add;
      r->add |= add;
    }
    return v;
  }
} * seg;
vector<long long int> v;
vector<pair<long long int, long long int> > edges;
long long int index(long long int x) {
  assert(*lower_bound((v).begin(), (v).end(), x) == x);
  return lower_bound((v).begin(), (v).end(), x) - v.begin() + 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> l >> r;
    v.push_back(l);
    v.push_back(r);
    edges.push_back(pair<long long int, long long int>(l, r));
  }
  sort((v).begin(), (v).end());
  v.resize(unique((v).begin(), (v).end()) - v.begin());
  seg = new node(0, v.size() + 1);
  for (auto i : edges) {
    l = i.first, r = i.second;
    seg->update(index(l), index(r));
    seg->value();
    cout << seg->v << '\n';
  }
}
