#include <bits/stdc++.h>
using namespace std;
inline unsigned long long read() {
  register unsigned long long res = 0, f = 1;
  register char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = -1;
  do {
    res = res * 10 + ch - '0';
  } while (isdigit(ch = getchar()));
  return res * f;
}
const int N = 1e6 + 5;
struct node {
  unsigned long long lft, rht;
  mutable bool val;
  inline node(unsigned long long l, unsigned long long r = 0, bool v = 0)
      : lft(l), rht(r), val(v) {}
  inline bool operator<(node a) const { return lft < a.lft; }
};
set<node> s;
inline set<node>::iterator split(unsigned long long pos) {
  set<node>::iterator it = s.lower_bound(node(pos));
  if (it->lft == pos && it != s.end()) return it;
  --it;
  unsigned long long l = it->lft, r = it->rht;
  bool v = it->val;
  s.erase(it);
  s.insert(node(l, pos - 1, v));
  return s.insert(node(pos, r, v)).first;
}
inline void assign(unsigned long long l, unsigned long long r, bool val) {
  set<node>::iterator itr = split(r + 1), itl = split(l);
  s.erase(itl, itr);
  s.insert(node(l, r, val));
}
inline void reverse(unsigned long long l, unsigned long long r) {
  set<node>::iterator itr = split(r + 1), itl = split(l);
  for (register set<node>::iterator it = itl; it != itr; ++it) it->val ^= 1;
}
inline unsigned long long query() {
  for (register set<node>::iterator it = s.begin(); it != s.end(); ++it) {
    if (it->val == 0) return it->lft;
  }
  return -1;
}
int main() {
  int m = read();
  s.insert(node(1, 1e18, 0));
  for (register int i = 1; i <= m; ++i) {
    unsigned long long op = read(), l = read(), r = read();
    if (op == 1)
      assign(l, r, 1);
    else if (op == 2)
      assign(l, r, 0);
    else
      reverse(l, r);
    printf("%lld\n", query());
  }
  return 0;
}
