#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long ll[maxn], rr[maxn];
long long a[maxn << 2];
int w[maxn];
struct Seg {
  int sum[maxn << 4];
  int lazy[maxn << 4];
  int lazy_r[maxn << 4];
  inline void pushup(int rt) { sum[rt] = sum[rt << 1 | 1] + sum[rt << 1]; }
  inline void pushdown(int rt, int len) {
    if (lazy[rt] != -1) {
      sum[rt << 1] = (len - (len >> 1)) * lazy[rt];
      sum[rt << 1 | 1] = (len >> 1) * lazy[rt];
      lazy[rt << 1] = lazy[rt << 1 | 1] = lazy[rt];
      lazy_r[rt << 1 | 1] = lazy_r[rt << 1] = 0;
      lazy[rt] = -1;
    }
    if (lazy_r[rt]) {
      sum[rt << 1] = len - (len >> 1) - sum[rt << 1];
      sum[rt << 1 | 1] = (len >> 1) - sum[rt << 1 | 1];
      lazy_r[rt << 1] = 1 - lazy_r[rt << 1];
      lazy_r[rt << 1 | 1] = 1 - lazy_r[rt << 1 | 1];
      lazy_r[rt] = 0;
    }
  }
  void build(int l, int r, int rt) {
    lazy[rt] = -1;
    lazy_r[rt] = 0;
    if (l == r) {
      sum[rt] = 0;
      return;
    }
    int m = (l + r) >> 1;
    build(l, m, rt << 1);
    build(m + 1, r, rt << 1 | 1);
    pushup(rt);
  }
  void updata(int L, int R, int val, int l, int r, int rt) {
    if (L <= l && r <= R) {
      sum[rt] = (r - l + 1) * val;
      lazy[rt] = val;
      lazy_r[rt] = 0;
      return;
    }
    pushdown(rt, r - l + 1);
    int m = (l + r) >> 1;
    if (m >= L) updata(L, R, val, l, m, rt << 1);
    if (R > m) updata(L, R, val, m + 1, r, rt << 1 | 1);
    pushup(rt);
  }
  void updata_r(int L, int R, int l, int r, int rt) {
    if (L <= l && r <= R) {
      sum[rt] = (r - l + 1) - sum[rt];
      lazy_r[rt] = 1 - lazy_r[rt];
      return;
    }
    pushdown(rt, r - l + 1);
    int m = (l + r) >> 1;
    if (m >= L) updata_r(L, R, l, m, rt << 1);
    if (R > m) updata_r(L, R, m + 1, r, rt << 1 | 1);
    pushup(rt);
  }
  long long query(int l, int r, int rt) {
    if (l == r) {
      return a[l - 1];
    }
    int len = r - l + 1;
    pushdown(rt, len);
    int m = (l + r) >> 1;
    if (sum[rt << 1] < (len - len / 2))
      return query(l, m, rt << 1);
    else
      return query(m + 1, r, rt << 1 | 1);
  }
} seg;
int main() {
  int n;
  scanf("%d", &n);
  int e = 0;
  a[e++] = 1;
  for (int i = 0; i < n; i++) {
    scanf("%d%I64d%I64d", &w[i], &ll[i], &rr[i]);
    a[e++] = ll[i];
    a[e++] = rr[i];
  }
  sort(a, a + e);
  int m = unique(a, a + e) - a;
  int te = m;
  for (int i = 1; i < te; i++) {
    if (a[i - 1] + 1 != a[i]) a[m++] = a[i - 1] + 1;
  }
  sort(a, a + m);
  a[m] = a[m - 1] + 1;
  m++;
  seg.build(1, m, 1);
  int l, r;
  for (int i = 0; i < n; i++) {
    l = lower_bound(a, a + m, ll[i]) - a;
    r = lower_bound(a, a + m, rr[i]) - a;
    l++;
    r++;
    if (w[i] == 1)
      seg.updata(l, r, 1, 1, m, 1);
    else if (w[i] == 2)
      seg.updata(l, r, 0, 1, m, 1);
    else
      seg.updata_r(l, r, 1, m, 1);
    printf("%I64d\n", seg.query(1, m, 1));
  }
}
