#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chkmax(T &a, T b) {
  return (a < b) ? a = b, 1 : 0;
}
template <typename T>
bool chkmin(T &a, T b) {
  return (a > b) ? a = b, 1 : 0;
}
inline long long read() {
  long long x = 0, fh = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') fh = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ '0');
  return x * fh;
}
int m;
struct node {
  long long l, r, opt;
} p[100005];
int root;
long long tree[1600005];
long long lsh[1600005];
int rs[1600005], ls[1600005], lazy[1600005], cnt;
void pushup(int rt, long long l, long long r, int val) {
  if (val <= 2) {
    tree[rt] = 1ll * (r - l + 1) * (val - 1);
    lazy[rt] = val;
  } else {
    tree[rt] = (r - l + 1 - tree[rt]);
    lazy[rt] = 3 - lazy[rt];
  }
}
void pushdown(int rt, long long l, long long r) {
  pushup(rt << 1, l, ((l + r) >> 1), lazy[rt]);
  pushup(rt << 1 | 1, ((l + r) >> 1) + 1, r, lazy[rt]);
  lazy[rt] = 0;
}
void update(int rt, long long l, long long r, long long L, long long R,
            int val) {
  if (L <= l && r <= R) {
    pushup(rt, l, r, val);
    return;
  }
  if (lazy[rt]) pushdown(rt, l, r);
  if (L <= ((l + r) >> 1)) update(rt << 1, l, ((l + r) >> 1), L, R, val);
  if (R > ((l + r) >> 1)) update(rt << 1 | 1, ((l + r) >> 1) + 1, r, L, R, val);
  tree[rt] = tree[rt << 1] + tree[rt << 1 | 1];
}
long long query(int rt, long long l, long long r) {
  if (!tree[rt]) return l;
  if (lazy[rt]) pushdown(rt, l, r);
  long long res = 0;
  if ((((l + r) >> 1) - l + 1) != tree[rt << 1])
    res = query(rt << 1, l, ((l + r) >> 1));
  else
    res = query(rt << 1 | 1, ((l + r) >> 1) + 1, r);
  tree[rt] = tree[rt << 1] + tree[rt << 1 | 1];
  return res;
}
int main() {
  m = read();
  long long maxn = 0;
  for (int i = (1), _end_ = (int)(m); i <= _end_; ++i) {
    p[i].opt = read();
    p[i].l = read();
    p[i].r = read();
    chkmax(maxn, p[i].r + 1);
    lsh[++cnt] = p[i].l;
    lsh[++cnt] = p[i].r;
    lsh[++cnt] = p[i].r + 1;
  }
  lsh[++cnt] = 1;
  sort(lsh + 1, lsh + cnt + 1);
  cnt = unique(lsh + 1, lsh + cnt + 1) - lsh - 1;
  for (int i = (1), _end_ = (int)(m); i <= _end_; ++i) {
    p[i].l = lower_bound(lsh + 1, lsh + cnt + 1, p[i].l) - lsh;
    p[i].r = lower_bound(lsh + 1, lsh + cnt + 1, p[i].r) - lsh;
    if (p[i].opt == 1) {
      update(1, 1, cnt, p[i].l, p[i].r, 2);
    } else if (p[i].opt == 2) {
      update(1, 1, cnt, p[i].l, p[i].r, 1);
    } else
      update(1, 1, cnt, p[i].l, p[i].r, 3);
    printf("%I64d\n", lsh[query(1, 1, cnt)]);
  }
  return 0;
}
