#include <bits/stdc++.h>
using namespace std;
struct hehe {
  unsigned long long l, r;
  mutable bool z;
  inline bool operator<(hehe y) const { return l < y.l; }
};
set<hehe> s;
inline set<hehe>::iterator split(unsigned long long pos) {
  hehe qaq;
  qaq.l = pos;
  qaq.r = 0;
  qaq.z = 0;
  set<hehe>::iterator itp = s.lower_bound(qaq);
  if (itp->l == pos && itp != s.end()) return itp;
  itp--;
  unsigned long long l = itp->l, r = itp->r;
  bool val = itp->z;
  s.erase(itp);
  qaq.l = l;
  qaq.r = pos - 1;
  qaq.z = val;
  s.insert(qaq);
  qaq.l = pos;
  qaq.r = r;
  qaq.z = val;
  set<hehe>::iterator ret = s.insert(qaq).first;
  return ret;
}
inline unsigned long long read() {
  unsigned long long s = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s;
}
inline void rev(unsigned long long l, unsigned long long r) {
  set<hehe>::iterator itr, itl;
  itr = split(r + 1);
  itl = split(l);
  for (set<hehe>::iterator it = itl; it != itr; ++it) it->z ^= 1;
}
inline void fz(unsigned long long l, unsigned long long r,
               unsigned long long val) {
  set<hehe>::iterator itl, itr;
  itr = split(r + 1);
  itl = split(l);
  s.erase(itl, itr);
  hehe qwq;
  qwq.l = l;
  qwq.r = r;
  qwq.z = val;
  s.insert(qwq);
}
inline unsigned long long que() {
  for (set<hehe>::iterator it = s.begin(); it != s.end(); ++it) {
    if (it->z == 0) return it->l;
  }
  return 1000000000000000001llu;
}
signed main() {
  unsigned long long n;
  n = read();
  hehe qwq;
  qwq.l = 1;
  qwq.r = 1000000000000000000llu;
  qwq.z = 0;
  s.insert(qwq);
  while (n--) {
    unsigned long long opt, l, r;
    opt = read();
    l = read();
    r = read();
    if (opt == 1)
      fz(l, r, 1);
    else if (opt == 2)
      fz(l, r, 0);
    else if (opt == 3)
      rev(l, r);
    printf("%lld\n", que());
  }
  return 0;
}
