#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5 + 10;
long long n, Q, q[N], typ[N], L[N], R[N];
inline long long rint() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
struct lwh {
  long long ls, rs, sum, tag, revtag;
} sgt[N << 2];
inline void pushup(long long p) {
  sgt[p].sum = sgt[p << 1].sum + sgt[p << 1 | 1].sum;
}
inline void pushdown(long long p) {
  long long mid = (sgt[p].ls + sgt[p].rs) >> 1;
  if (sgt[p].tag != -1) {
    sgt[p << 1].tag = sgt[p << 1 | 1].tag = sgt[p].tag;
    sgt[p << 1].revtag = sgt[p << 1 | 1].revtag = 0;
    if (sgt[p].tag)
      sgt[p << 1].sum = mid - sgt[p].ls + 1,
               sgt[p << 1 | 1].sum = sgt[p].rs - mid;
    else
      sgt[p << 1].sum = sgt[p << 1 | 1].sum = 0;
    sgt[p].tag = -1;
  }
  if (sgt[p].revtag) {
    if (sgt[p << 1].tag != -1)
      sgt[p << 1].tag ^= 1;
    else
      sgt[p << 1].revtag ^= 1;
    if (sgt[p << 1 | 1].tag != -1)
      sgt[p << 1 | 1].tag ^= 1;
    else
      sgt[p << 1 | 1].revtag ^= 1;
    sgt[p << 1].sum = mid - sgt[p].ls + 1 - sgt[p << 1].sum,
             sgt[p << 1 | 1].sum = sgt[p].rs - mid - sgt[p << 1 | 1].sum;
    sgt[p].revtag = 0;
  }
}
inline void Build(long long p, long long l, long long r) {
  sgt[p] = (lwh){l, r, 0, -1, 0};
  if (l == r) return;
  long long mid = (l + r) >> 1;
  Build(p << 1, l, mid);
  Build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
inline void update(long long p, long long l, long long r, long long typ) {
  if (l <= sgt[p].ls && r >= sgt[p].rs) {
    if (sgt[p].ls == sgt[p].rs) {
      if (typ == 1)
        sgt[p].sum = 1;
      else if (typ == 2)
        sgt[p].sum = 0;
      else
        sgt[p].sum ^= 1;
    } else {
      if (typ == 1)
        sgt[p].tag = 1, sgt[p].revtag = 0,
        sgt[p].sum = sgt[p].rs - sgt[p].ls + 1;
      else if (typ == 2)
        sgt[p].tag = sgt[p].revtag = sgt[p].sum = 0;
      else {
        if (sgt[p].tag != -1)
          sgt[p].tag ^= 1;
        else
          sgt[p].revtag ^= 1;
        sgt[p].sum = sgt[p].rs - sgt[p].ls + 1 - sgt[p].sum;
      }
    }
    return;
  }
  pushdown(p);
  long long mid = (sgt[p].ls + sgt[p].rs) >> 1;
  if (l <= mid) update(p << 1, l, r, typ);
  if (r > mid) update(p << 1 | 1, l, r, typ);
  pushup(p);
}
inline long long query(long long p) {
  if (sgt[p].ls == sgt[p].rs) return sgt[p].ls;
  pushdown(p);
  long long mid = (sgt[p].ls + sgt[p].rs) >> 1;
  if (sgt[p << 1].sum < mid - sgt[p].ls + 1) return query(p << 1);
  return query(p << 1 | 1);
}
signed main() {
  Q = rint();
  q[++n] = 1;
  for (register long long i = (1), iend = (Q); i <= iend; ++i) {
    typ[i] = rint(), L[i] = rint(), R[i] = rint();
    q[++n] = L[i], q[++n] = R[i], q[++n] = R[i] + 1;
  }
  sort(q + 1, q + n + 1);
  n = unique(q + 1, q + n + 1) - q - 1;
  Build(1, 1, n);
  for (register long long i = (1), iend = (Q); i <= iend; ++i) {
    L[i] = lower_bound(q + 1, q + n + 1, L[i]) - q;
    R[i] = lower_bound(q + 1, q + n + 1, R[i]) - q;
    update(1, L[i], R[i], typ[i]);
    printf("%lld\n", q[query(1)]);
  }
  return 0;
}
