#include <bits/stdc++.h>
using namespace std;
class BIT {
int n;
std::vector<int> su;
public:
BIT(int n) : n(n), su(n + 1,0) {}
void add(int x, int v) {
for (; x <= n; x += x & (-x)) {
su[x] += v;
}
}
int query(int x) {
int res = 0;
for (; x; x &= x - 1) {
res += su[x];
}
return res;
}
};
int main() {
int q;
cin >> q;
BIT b(300005);
int maxLen = 0;
while (q--) {
int l,r;
cin >> l >> r;
if(b.query(r)-b.query(l-1)==0){
b.add(l, 1);
b.add(r,1);
if(r-l+1>maxLen){
maxLen = r-l+1;
}
}
cout << maxLen+1 << endl;
}
}