#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int sum = 0, p = 1;
  char ch = getchar();
  while (!(('0' <= ch && ch <= '9') || ch == '-')) ch = getchar();
  if (ch == '-') p = -1, ch = getchar();
  while ('0' <= ch && ch <= '9') sum = sum * 10 + ch - 48, ch = getchar();
  return sum * p;
}
const int maxn = 150020;
map<long long, int> mp;
int m, cnt;
long long s[maxn * 3], n;
struct qu {
  long long l, r;
  int type;
} a[maxn];
struct node {
  int s, lz, id;
} c[maxn * 10];
inline void make_tree(int o, int l, int r) {
  c[o].s = 0;
  c[o].lz = -1;
  c[o].id = 0;
  if (l == r) return;
  int mid = (l + r) >> 1;
  make_tree((o << 1), l, mid);
  make_tree((o << 1 | 1), mid + 1, r);
}
void maintain(int o, int l, int r) {
  c[o].s = c[(o << 1)].s + c[(o << 1 | 1)].s;
}
void pushdown(int o, int l, int r) {
  int mid = (l + r) >> 1;
  if (c[o].lz != -1) {
    c[(o << 1)].lz = c[(o << 1 | 1)].lz = c[o].lz;
    c[(o << 1)].s = (mid - l + 1) * c[o].lz;
    c[(o << 1 | 1)].s = (r - mid) * c[o].lz;
    c[(o << 1)].id = c[(o << 1 | 1)].id = 0;
    c[o].lz = -1;
  }
  if (c[o].id) {
    c[(o << 1)].id ^= 1;
    c[(o << 1 | 1)].id ^= 1;
    c[(o << 1)].s = (mid - l + 1) - c[(o << 1)].s;
    c[(o << 1 | 1)].s = (r - mid) - c[(o << 1 | 1)].s;
    c[o].id = 0;
  }
}
inline void updates(int ql, int qr, int x, int o, int l, int r) {
  pushdown(o, l, r);
  if (ql == l && r == qr) {
    c[o].s = (r - l + 1) * x;
    c[o].lz = x;
    c[o].id = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (ql > mid) {
    updates(ql, qr, x, (o << 1 | 1), mid + 1, r);
  } else if (qr <= mid) {
    updates(ql, qr, x, (o << 1), l, mid);
  } else {
    updates(ql, mid, x, (o << 1), l, mid);
    updates(mid + 1, qr, x, (o << 1 | 1), mid + 1, r);
  }
  maintain(o, l, r);
}
inline void updatex(int ql, int qr, int o, int l, int r) {
  pushdown(o, l, r);
  if (ql == l && r == qr) {
    c[o].s = (r - l + 1) - c[o].s;
    c[o].id ^= 1;
    c[o].lz = -1;
    return;
  }
  int mid = (l + r) >> 1;
  if (ql > mid) {
    updatex(ql, qr, (o << 1 | 1), mid + 1, r);
  } else if (qr <= mid) {
    updatex(ql, qr, (o << 1), l, mid);
  } else {
    updatex(ql, mid, (o << 1), l, mid);
    updatex(mid + 1, qr, (o << 1 | 1), mid + 1, r);
  }
  maintain(o, l, r);
}
void init() {
  m = read();
  for (register int i = (1), _end_ = (m); i <= _end_; i++) {
    cin >> a[i].type >> a[i].l >> a[i].r;
    a[i].r++;
    s[++cnt] = a[i].l;
    s[++cnt] = a[i].r;
  }
  s[++cnt] = 1;
  sort(s + 1, s + cnt + 1);
  n = unique(s + 1, s + cnt + 1) - (s + 1);
  for (register int i = (1), _end_ = (n); i <= _end_; i++) mp[s[i]] = i;
  make_tree(1, 1, n);
}
void query(int o, int l, int r) {
  pushdown(o, l, r);
  if (l == r) {
    cout << s[l] << endl;
    return;
  }
  int mid = (l + r) >> 1;
  if (c[(o << 1)].s < mid - l + 1)
    query((o << 1), l, mid);
  else
    query((o << 1 | 1), mid + 1, r);
}
void doing() {
  for (register int i = (1), _end_ = (m); i <= _end_; i++) {
    int type = a[i].type, l = mp[a[i].l], r = mp[a[i].r] - 1;
    if (type == 1) {
      updates(l, r, 1, 1, 1, n);
    } else if (type == 2) {
      updates(l, r, 0, 1, 1, n);
    } else {
      updatex(l, r, 1, 1, n);
    }
    query(1, 1, n);
  }
}
int main() {
  init();
  doing();
  return 0;
}
