#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int n, sum[maxn << 2], cov[maxn << 2], tot;
bool rev[maxn << 2];
long long mp[maxn];
struct Query {
  int op;
  long long l, r;
} q[maxn];
inline void pushup(int rt) { sum[rt] = sum[(rt << 1)] + sum[(rt << 1 | 1)]; }
inline void pushdown(int rt, int len) {
  if (cov[rt] != -1) {
    sum[(rt << 1)] = (len - (len >> 1)) * cov[rt];
    sum[(rt << 1 | 1)] = (len >> 1) * cov[rt];
    cov[(rt << 1)] = cov[(rt << 1 | 1)] = cov[rt];
    rev[rt] = 0;
    cov[rt] = -1;
  }
  if (rev[rt]) {
    sum[(rt << 1)] = (len - (len >> 1)) - sum[(rt << 1)];
    sum[(rt << 1 | 1)] = (len >> 1) - sum[(rt << 1 | 1)];
    if (cov[(rt << 1)] >= 0)
      cov[(rt << 1)] ^= 1;
    else
      rev[(rt << 1)] ^= 1;
    if (cov[(rt << 1 | 1)] >= 0)
      cov[(rt << 1 | 1)] ^= 1;
    else
      rev[(rt << 1 | 1)] ^= 1;
    rev[rt] = 0;
  }
}
void build(int l, int r, int rt) {
  sum[rt] = rev[rt] = 0;
  cov[rt] = -1;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(l, mid, (rt << 1));
  build(mid + 1, r, (rt << 1 | 1));
}
void cover(int L, int R, int C, int l, int r, int rt) {
  if (L <= l && r <= R) return sum[rt] = (r - l + 1) * C, cov[rt] = C, void();
  pushdown(rt, r - l + 1);
  int mid = (l + r) >> 1;
  if (L <= mid) cover(L, R, C, l, mid, (rt << 1));
  if (R > mid) cover(L, R, C, mid + 1, r, (rt << 1 | 1));
  pushup(rt);
}
void reverse(int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) {
    sum[rt] = (r - l + 1) - sum[rt];
    if (cov[rt] >= 0)
      cov[rt] ^= 1;
    else
      rev[rt] ^= 1;
    return;
  }
  pushdown(rt, r - l + 1);
  int mid = (l + r) >> 1;
  if (L <= mid) reverse(L, R, l, mid, (rt << 1));
  if (R > mid) reverse(L, R, mid + 1, r, (rt << 1 | 1));
  pushup(rt);
}
int query(int l, int r, int rt) {
  if (l == r) return l;
  pushdown(rt, r - l + 1);
  int mid = (l + r) >> 1;
  if (sum[(rt << 1)] == (r - l + 1) - ((r - l + 1) >> 1))
    return query(mid + 1, r, (rt << 1 | 1));
  return query(l, mid, (rt << 1));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%I64d%I64d", &q[i].op, &q[i].l, &q[i].r);
    mp[++tot] = q[i].l;
    mp[++tot] = q[i].r + 1;
  }
  mp[++tot] = 1;
  sort(mp + 1, mp + tot + 1);
  tot = unique(mp + 1, mp + tot + 1) - mp - 1;
  build(1, tot, 1);
  for (int i = 1; i <= n; i++) {
    q[i].l = lower_bound(mp + 1, mp + tot + 1, q[i].l) - mp;
    q[i].r = lower_bound(mp + 1, mp + tot + 1, q[i].r + 1) - mp - 1;
    if (q[i].op == 1) cover(q[i].l, q[i].r, 1, 1, tot, 1);
    if (q[i].op == 2) cover(q[i].l, q[i].r, 0, 1, tot, 1);
    if (q[i].op == 3) reverse(q[i].l, q[i].r, 1, tot, 1);
    printf("%I64d\n", mp[query(1, tot, 1)]);
  }
  return 0;
}
