#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 21, inf = 1e18 + 21, mod = 1e9 + 7;
int n;
long long t[MAXN], l[MAXN], r[MAXN], c[MAXN << 2];
int sum[MAXN << 3], lazy[MAXN << 3];
inline void pushup(int rt) { sum[rt] = sum[rt << 1] + sum[rt << 1 | 1]; }
inline void pushdown(int l, int r, int rt) {
  if (!lazy[rt]) return;
  int m = (l + r) >> 1;
  if (lazy[rt] < 3) {
    sum[rt << 1] = (2 - lazy[rt]) * (m - l + 1);
    sum[rt << 1 | 1] = (2 - lazy[rt]) * (r - m);
    lazy[rt << 1] = lazy[rt << 1 | 1] = lazy[rt];
  } else {
    sum[rt << 1] = m - l + 1 - sum[rt << 1];
    sum[rt << 1 | 1] = r - m - sum[rt << 1 | 1];
    lazy[rt << 1] = 3 - lazy[rt << 1];
    lazy[rt << 1 | 1] = 3 - lazy[rt << 1 | 1];
  }
  lazy[rt] = 0;
}
int get(int l, int r, int rt) {
  if (l == r) return l;
  pushdown(l, r, rt);
  int m = (l + r) >> 1;
  if (sum[rt << 1] < m - l + 1) return get(l, m, rt << 1);
  return get(m + 1, r, rt << 1 | 1);
}
void update(int L, int R, int on, int l, int r, int rt) {
  if (L <= l && r <= R) {
    if (on < 3) {
      sum[rt] = (2 - on) * (r - l + 1);
      lazy[rt] = on;
    } else {
      sum[rt] = r - l + 1 - sum[rt];
      lazy[rt] = 3 - lazy[rt];
    }
    return;
  }
  pushdown(l, r, rt);
  int m = (l + r) >> 1;
  if (L <= m) update(L, R, on, l, m, rt << 1);
  if (R > m) update(L, R, on, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
void solve(int i, int m) {
  l[i] = lower_bound(c + 1, c + 1 + m, l[i]) - c;
  r[i] = lower_bound(c + 1, c + 1 + m, r[i]) - c;
  update(l[i], r[i], t[i], 1, m, 1);
  cout << c[get(1, m, 1)] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> t[i] >> l[i] >> r[i];
  int m = 1;
  c[m] = 1;
  for (int i = 1; i <= n; i++) {
    c[++m] = l[i];
    c[++m] = r[i];
    c[++m] = r[i] + 1;
  }
  sort(c + 1, c + 1 + m);
  m = unique(c + 1, c + 1 + m) - c - 1;
  for (int i = 1; i <= n; i++) solve(i, m);
  return 0;
}
