#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
const double eps = (double)1e-9;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 300500;
struct query {
  int tp;
  long long l, r;
  query(){};
  query(int x, long long y, long long z) : tp(x), l(y), r(z){};
} q[N];
long long a[N];
int n, sz, t[N << 2];
bool set0[N << 2], set1[N << 2], inv[N << 2];
inline int get(long long x) {
  int l = 1, r = sz, res;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (a[mid] <= x) {
      res = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return res;
}
inline void push(int v, int l, int r) {
  int mid = (l + r) >> 1;
  if (set1[v]) {
    t[v << 1] = mid - l + 1;
    set1[v << 1] = 1;
    t[v << 1 | 1] = r - mid;
    set1[v << 1 | 1] = 1;
    set0[v << 1] = set0[v << 1 | 1] = 0;
    inv[v << 1] = inv[v << 1 | 1] = 0;
    set1[v] = 0;
  }
  if (set0[v]) {
    t[v << 1] = t[v << 1 | 1] = 0;
    set0[v << 1] = set0[v << 1 | 1] = 1;
    set1[v << 1] = set1[v << 1 | 1] = 0;
    inv[v << 1] = inv[v << 1 | 1] = 0;
    set0[v] = 0;
  }
  if (inv[v]) {
    t[v << 1] = mid - l + 1 - t[v << 1];
    inv[v << 1] ^= 1;
    t[v << 1 | 1] = r - mid - t[v << 1 | 1];
    inv[v << 1 | 1] ^= 1;
    inv[v] = 0;
  }
}
void upd1(int v, int l, int r, int lx, int rx) {
  if (rx < l || r < lx) return;
  if (lx <= l && r <= rx) {
    set1[v] = 1;
    set0[v] = 0;
    inv[v] = 0;
    t[v] = r - l + 1;
    return;
  }
  push(v, l, r);
  int mid = (l + r) >> 1;
  upd1(v << 1, l, mid, lx, rx);
  upd1(v << 1 | 1, mid + 1, r, lx, rx);
  t[v] = t[v << 1] + t[v << 1 | 1];
}
void upd0(int v, int l, int r, int lx, int rx) {
  if (rx < l || r < lx) return;
  if (lx <= l && r <= rx) {
    set0[v] = 1;
    set1[v] = 0;
    inv[v] = 0;
    t[v] = 0;
    return;
  }
  push(v, l, r);
  int mid = (l + r) >> 1;
  upd0(v << 1, l, mid, lx, rx);
  upd0(v << 1 | 1, mid + 1, r, lx, rx);
  t[v] = t[v << 1] + t[v << 1 | 1];
}
void invert(int v, int l, int r, int lx, int rx) {
  if (rx < l || r < lx) return;
  if (lx <= l && r <= rx) {
    t[v] = r - l + 1 - t[v];
    inv[v] ^= 1;
    return;
  }
  push(v, l, r);
  int mid = (l + r) >> 1;
  invert(v << 1, l, mid, lx, rx);
  invert(v << 1 | 1, mid + 1, r, lx, rx);
  t[v] = t[v << 1] + t[v << 1 | 1];
}
int get(int v, int l, int r) {
  if (l == r) return r;
  push(v, l, r);
  int mid = (l + r) >> 1;
  if (t[v << 1] == mid - l + 1)
    return get(v << 1 | 1, mid + 1, r);
  else
    return get(v << 1, l, mid);
}
int main() {
  scanf("%d", &n);
  a[++sz] = 1;
  for (int i = 1; i <= n; i++) {
    int tp;
    long long l, r;
    scanf("%d %I64d %I64d", &tp, &l, &r);
    q[i] = query(tp, l, r);
    a[++sz] = l;
    a[++sz] = r;
    a[++sz] = r + 1;
  }
  sort(a + 1, a + 1 + sz);
  sz = unique(a + 1, a + 1 + sz) - a - 1;
  for (int i = 1; i <= n; i++) {
    q[i].l = get(q[i].l);
    q[i].r = get(q[i].r);
  }
  for (int i = 1; i <= n; i++) {
    if (q[i].tp == 1)
      upd1(1, 1, sz, q[i].l, q[i].r);
    else if (q[i].tp == 2)
      upd0(1, 1, sz, q[i].l, q[i].r);
    else
      invert(1, 1, sz, q[i].l, q[i].r);
    printf("%I64d\n", a[get(1, 1, sz)]);
  }
  return 0;
}
