#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-9;
const int N = 1200000 + 10, maxn = 100000 + 10, inf = 0x3f3f3f3f,
          INF = 0x3f3f3f3f3f3f3f3f;
struct qu {
  int t;
  long long l, r;
} q[N];
int lazy[N << 2], value[N << 2];
int cnt;
long long Hash[N << 2];
void pushup(int rt) { value[rt] = value[rt << 1] + value[rt << 1 | 1]; }
void pushdown(int l, int r, int rt) {
  int m = (l + r) >> 1;
  if (lazy[rt] == 1) {
    value[rt << 1] = m - l + 1;
    value[rt << 1 | 1] = r - m;
    lazy[rt << 1] = lazy[rt << 1 | 1] = 1;
  } else if (lazy[rt] == 2) {
    value[rt << 1] = value[rt << 1 | 1] = 0;
    lazy[rt << 1] = lazy[rt << 1 | 1] = 2;
  } else if (lazy[rt] == 3) {
    value[rt << 1] = m - l + 1 - value[rt << 1];
    value[rt << 1 | 1] = r - m - value[rt << 1 | 1];
    lazy[rt << 1] = 3 - lazy[rt << 1];
    lazy[rt << 1 | 1] = 3 - lazy[rt << 1 | 1];
  }
  lazy[rt] = 0;
}
void build(int l, int r, int rt) {
  value[rt] = 0, lazy[rt] = 0;
  if (l == r) return;
  int m = (l + r) >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
}
void update(int L, int R, int op, int l, int r, int rt) {
  if (L <= l && r <= R) {
    if (op == 1) {
      value[rt] = r - l + 1;
      lazy[rt] = op;
    } else if (op == 2) {
      value[rt] = 0;
      lazy[rt] = op;
    } else {
      if (lazy[rt]) pushdown(l, r, rt);
      value[rt] = r - l + 1 - value[rt];
      lazy[rt] = op;
    }
    return;
  }
  pushdown(l, r, rt);
  int m = (l + r) >> 1;
  if (L <= m) update(L, R, op, l, m, rt << 1);
  if (m < R) update(L, R, op, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
int query(int l, int r, int rt) {
  if (l == r) return l;
  pushdown(l, r, rt);
  int m = (l + r) >> 1;
  if (value[rt << 1] == m - l + 1)
    return query(m + 1, r, rt << 1 | 1);
  else
    return query(l, m, rt << 1);
}
void add(long long x) {
  if (x != 0) Hash[cnt++] = x;
}
int main() {
  int n;
  cnt = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%lld%lld", &q[i].t, &q[i].l, &q[i].r);
    add(q[i].l - 1), add(q[i].l), add(q[i].l + 1);
    add(q[i].r - 1), add(q[i].r), add(q[i].r + 1);
  }
  Hash[cnt++] = 1;
  sort(Hash, Hash + cnt);
  cnt = unique(Hash, Hash + cnt) - Hash;
  build(1, cnt, 1);
  for (int i = 0; i < n; i++) {
    int op = q[i].t;
    int tel = lower_bound(Hash, Hash + cnt, q[i].l) - Hash;
    int ter = lower_bound(Hash, Hash + cnt, q[i].r) - Hash;
    update(tel + 1, ter + 1, q[i].t, 1, cnt, 1);
    int ans = query(1, cnt, 1);
    printf("%lld\n", Hash[ans - 1]);
  }
  return 0;
}
