#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
int segtree[N << 4];
int lazy[N << 4];
map<long long, int> ma;
map<int, long long> mb;
int sz;
int tt[N];
long long ll[N], rr[N];
void shift(int id, int l, int r) {
  if (lazy[id]) {
    if (lazy[id] == 1) {
      segtree[id] = r - l;
      if (l + 1 < r) lazy[id + id] = lazy[id + id + 1] = lazy[id];
    } else if (lazy[id] == 2) {
      segtree[id] = 0;
      if (l + 1 < r) lazy[id + id] = lazy[id + id + 1] = lazy[id];
    } else if (lazy[id] == 3) {
      segtree[id] = r - l - segtree[id];
      if (l + 1 < r)
        lazy[id + id] = 3 - lazy[id + id],
                  lazy[id + id + 1] = 3 - lazy[id + id + 1];
    }
    lazy[id] = 0;
  }
}
void update(int x, int y, int t, int id = 1, int l = 0, int r = sz) {
  shift(id, l, r);
  if (l >= y || r <= x) return;
  if (l >= x && r <= y) {
    if (t == 1)
      segtree[id] = r - l;
    else if (t == 2)
      segtree[id] = 0;
    else if (t == 3)
      segtree[id] = r - l - segtree[id];
    if (l + 1 < r) {
      if (t == 1 || t == 2)
        lazy[id + id] = lazy[id + id + 1] = t;
      else if (t == 3)
        lazy[id + id] = 3 - lazy[id + id],
                  lazy[id + id + 1] = 3 - lazy[id + id + 1];
    }
    return;
  }
  int mid = l + r >> 1;
  update(x, y, t, id + id, l, mid);
  update(x, y, t, id + id + 1, mid, r);
  segtree[id] = segtree[id + id] + segtree[id + id + 1];
}
int query(int id = 1, int l = 0, int r = sz) {
  shift(id, l, r);
  if (l + 1 == r) return l;
  int mid = l + r >> 1;
  int lef = 1 << 30;
  int rig = 1 << 30;
  shift(id + id, l, mid);
  shift(id + id + 1, mid, r);
  if (segtree[id + id] < mid - l)
    lef = query(id + id, l, mid);
  else if (segtree[id + id + 1] < r - mid)
    rig = query(id + id + 1, mid, r);
  return min(lef, rig);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%d %lld %lld", tt + i, ll + i, rr + i), ma[ll[i]], ma[rr[i] + 1];
  ma[1];
  for (auto &it : ma) {
    it.second = sz;
    mb[sz] = it.first;
    sz++;
  }
  for (int i = 0; i < n; i++) {
    update(ma[ll[i]], ma[rr[i] + 1], tt[i]);
    int ans = query();
    printf("%lld\n", mb[ans]);
  }
  return 0;
}
