#include <bits/stdc++.h>
using namespace std;
struct seg {
  long long val, lazy;
  seg *l, *r;
  seg() {
    val = lazy = 0;
    l = r = NULL;
  }
};
void upd(seg*& nd, long long l, long long r, long long ty) {
  if (nd == NULL) nd = new seg;
  if (ty == 0) return;
  if (ty == 1)
    nd->val = (r - l + 1), nd->lazy = 1;
  else if (ty == 2)
    nd->val = 0, nd->lazy = 2;
  else {
    if (nd->lazy == 0)
      nd->val = (r - l + 1) - nd->val, nd->lazy = 3;
    else if (nd->lazy == 1)
      nd->val = 0, nd->lazy = 2;
    else if (nd->lazy == 2)
      nd->val = (r - l + 1), nd->lazy = 1;
    else
      nd->val = (r - l + 1) - nd->val, nd->lazy = 0;
  }
}
void prop(seg*& nd, long long l, long long r) {
  long long mid = (l + r) / 2;
  upd(nd->l, l, mid, nd->lazy);
  upd(nd->r, mid + 1, r, nd->lazy);
  nd->lazy = 0;
}
seg* root;
void update(seg*& cur, long long a, long long b, long long ty, long long l,
            long long r) {
  if (a <= l && r <= b) {
    upd(cur, l, r, ty);
    return;
  }
  prop(cur, l, r);
  long long mid = (l + r) / 2;
  if (b <= mid)
    update(cur->l, a, b, ty, l, mid);
  else if (a > mid)
    update(cur->r, a, b, ty, mid + 1, r);
  else {
    update(cur->r, a, b, ty, mid + 1, r);
    update(cur->l, a, b, ty, l, mid);
  }
  cur->val = cur->l->val + cur->r->val;
}
long long query(seg*& cur, long long l, long long r) {
  if (l == r || cur->val == 0) return l;
  prop(cur, l, r);
  long long mid = (l + r) / 2;
  if (cur->l->val == (mid - l + 1))
    return query(cur->r, mid + 1, r);
  else
    return query(cur->l, l, mid);
}
long long n;
vector<pair<long long, pair<long long, long long> > > q;
map<long long, long long> mm, rmap;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  root = new seg;
  mm[1] = 1;
  for (long long i = 1; i <= n; ++i) {
    long long ty, l, r;
    cin >> ty >> l >> r;
    q.push_back(make_pair(ty, make_pair(l, r)));
    mm[l] = 1;
    mm[r + 1] = 1;
  }
  long long cnt = 0;
  for (auto it = mm.begin(); it != mm.end(); it++) {
    mm[it->first] = ++cnt;
    rmap[cnt] = it->first;
  }
  for (auto pp : q) {
    long long ty = pp.first, l = mm[pp.second.first],
              r = mm[pp.second.second + 1] - 1;
    update(root, l, r, ty, 1, cnt);
    cout << rmap[query(root, 1, cnt)] << "\n";
  }
}
