#include <bits/stdc++.h>
using namespace std;
int tree[1050000 + 5], lazy[1050000 + 5];
map<long long, int> compress;
long long uncompress[4 * 100000];
struct query {
  int t;
  long long l, r;
} q[100000 + 5];
void go(int id, int t) {
  if (t == 3)
    lazy[id] ^= 3;
  else
    lazy[id] = t;
}
void go2(int id, int L, int R) {
  int lt = id << 1, rt = lt | 1;
  if (lazy[id]) {
    if (lazy[id] == 1)
      tree[id] = (R - L + 1);
    else if (lazy[id] == 2)
      tree[id] = 0;
    else
      tree[id] = (R - L + 1) - tree[id];
    if (L != R) go(lt, lazy[id]), go(rt, lazy[id]);
    lazy[id] = 0;
  }
}
void update(int id, int L, int R, int rL, int rR, int t) {
  go2(id, L, R);
  if (L > rR or R < rL) return;
  int lt = id << 1, rt = lt | 1, mid = (L + R) >> 1;
  if (L >= rL and R <= rR) {
    if (t == 1)
      tree[id] = (R - L + 1);
    else if (t == 2)
      tree[id] = 0;
    else
      tree[id] = (R - L + 1) - tree[id];
    if (L != R) go(lt, t), go(rt, t);
    return;
  }
  update(lt, L, mid, rL, rR, t);
  update(rt, mid + 1, R, rL, rR, t);
  tree[id] = tree[lt] + tree[rt];
}
int get(int id, int L, int R) {
  int lt = id << 1, rt = lt | 1, mid = (L + R) >> 1;
  if (L == R) return L;
  go2(lt, L, mid);
  go2(rt, mid + 1, R);
  tree[id] = tree[lt] + tree[rt];
  if (tree[lt] != (mid - L + 1))
    return get(lt, L, mid);
  else
    return get(rt, mid + 1, R);
}
int main() {
  ios::sync_with_stdio(false);
  int n, i, sz, j;
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> q[i].t >> q[i].l >> q[i].r;
    compress[q[i].l], compress[q[i].r], compress[q[i].r + 1];
  }
  compress[1];
  i = 0;
  for (auto &z : compress) z.second = ++i, uncompress[i] = z.first;
  sz = i;
  for (i = 0; i < n; ++i) {
    update(1, 1, sz, compress[q[i].l], compress[q[i].r], q[i].t);
    cout << uncompress[get(1, 1, sz)] << endl;
  }
  return 0;
}
