#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100003;
int n;
struct Operation {
  char type;
  long long l, r;
} op[MaxN];
long long table[MaxN * 4];
int tot;
struct node {
  char statu;
  char inv_tag;
} T[MaxN * 16];
inline void pushinv(const int& p, const int& l, const int& r) {
  if (T[p].inv_tag) {
    if (T[p].statu != 1) {
      T[p].statu = 2 - T[p].statu;
      T[p].inv_tag = 0;
    } else {
      T[p * 2].inv_tag ^= 1;
      T[p * 2 + 1].inv_tag ^= 1;
      T[p].inv_tag = 0;
    }
  }
}
inline void pushstatu(const int& p, const int& l, const int& r) {
  if (l == r) return;
  if (T[p].statu != 1) {
    T[p * 2].statu = T[p * 2 + 1].statu = T[p].statu;
    T[p * 2].inv_tag = T[p * 2 + 1].inv_tag = 0;
  }
}
void add(int p, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) {
    T[p].statu = 2;
    T[p].inv_tag = 0;
    return;
  }
  pushinv(p, l, r);
  if (T[p].statu == 2) return;
  pushstatu(p, l, r);
  T[p].statu = 1;
  int mid = (l + r) / 2;
  if (ll <= mid) add(p * 2, l, mid, ll, rr);
  if (rr > mid) add(p * 2 + 1, mid + 1, r, ll, rr);
  pushinv(p * 2, l, mid), pushinv(p * 2 + 1, mid + 1, r);
  if (T[p * 2].statu == 2 && T[p * 2 + 1].statu == 2) T[p].statu = 2;
}
inline void add(int l, int r) { add(1, 1, tot, l, r); }
void del(int p, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) {
    T[p].statu = 0;
    T[p].inv_tag = 0;
    return;
  }
  pushinv(p, l, r);
  if (T[p].statu == 0) return;
  pushstatu(p, l, r);
  T[p].statu = 1;
  int mid = (l + r) / 2;
  if (ll <= mid) del(p * 2, l, mid, ll, rr);
  if (rr > mid) del(p * 2 + 1, mid + 1, r, ll, rr);
  pushinv(p * 2, l, mid), pushinv(p * 2 + 1, mid + 1, r);
  if (T[p * 2].statu == 0 && T[p * 2 + 1].statu == 0) T[p].statu = 0;
}
inline void del(int l, int r) { del(1, 1, tot, l, r); }
void inv(int p, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) {
    T[p].inv_tag ^= 1;
    return;
  }
  pushinv(p, l, r);
  pushstatu(p, l, r);
  int mid = (l + r) / 2;
  if (ll <= mid) inv(p * 2, l, mid, ll, rr);
  if (rr > mid) inv(p * 2 + 1, mid + 1, r, ll, rr);
  pushinv(p * 2, l, mid), pushinv(p * 2 + 1, mid + 1, r);
  T[p].statu = 1;
  if (T[p * 2].statu == 0 && T[p * 2 + 1].statu == 0) T[p].statu = 0;
  if (T[p * 2].statu == 2 && T[p * 2 + 1].statu == 2) T[p].statu = 2;
}
inline void inv(int l, int r) { inv(1, 1, tot, l, r); }
int query(int p, int l, int r, int ll, int rr) {
  pushinv(p, l, r);
  pushstatu(p, l, r);
  if (T[p].statu == 0) return l;
  if (T[p].statu == 2) return -1;
  int mid = (l + r) / 2;
  pushinv(p * 2, l, mid);
  pushinv(p * 2 + 1, mid + 1, r);
  if (T[p * 2].statu < 2)
    return query(p * 2, l, mid, ll, rr);
  else
    return query(p * 2 + 1, mid + 1, r, ll, rr);
}
inline int query(int l, int r) { return query(1, 1, tot, l, r); }
int main() {
  scanf("%d", &n);
  table[++tot] = 1;
  for (int i = 1; i <= n; ++i) {
    int type;
    long long l, r;
    scanf("%d%I64d%I64d", &type, &l, &r);
    op[i].type = type, op[i].l = l, op[i].r = r + 1;
    table[++tot] = l, table[++tot] = r;
    table[++tot] = l + 1, table[++tot] = r + 1;
  }
  sort(table + 1, table + tot + 1);
  tot = unique(table + 1, table + tot + 1) - table - 1;
  for (int i = 1; i <= n; ++i) {
    op[i].l = (lower_bound(table + 1, table + tot + 1, (op[i].l)) - table);
    op[i].r = (lower_bound(table + 1, table + tot + 1, (op[i].r)) - table);
  }
  for (int i = 1; i <= n; ++i) {
    if (op[i].type == 1) {
      add(op[i].l, op[i].r - 1);
    }
    if (op[i].type == 2) {
      del(op[i].l, op[i].r - 1);
    }
    if (op[i].type == 3) {
      inv(op[i].l, op[i].r - 1);
    }
    printf("%I64d\n", table[query(1, tot)]);
  }
  return 0;
}
