#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9, MOD = INF + 7;
const int N = 1e5 + 10;
int n, qt[N], seg[4 * 2 * N], lazy[4 * 2 * N];
long long ql[N], qr[N];
void apply(int id, int s, int e, int t) {
  if (t == 1) seg[id] = e - s, lazy[id] = 1;
  if (t == 2) seg[id] = 0, lazy[id] = 2;
  if (t == 3) seg[id] = e - s - seg[id], lazy[id] = 3 - lazy[id];
}
void shift(int id, int s, int e) {
  if (lazy[id] == 0) return;
  int md = (s + e) / 2;
  apply(2 * id, s, md, lazy[id]);
  apply(2 * id + 1, md, e, lazy[id]);
  lazy[id] = 0;
}
void update(int l, int r, int t, int id = 1, int s = 0, int e = n) {
  if (l >= e || s >= r) return;
  if (l <= s && e <= r) {
    apply(id, s, e, t);
    return;
  }
  shift(id, s, e);
  int md = (s + e) / 2;
  update(l, r, t, 2 * id, s, md);
  update(l, r, t, 2 * id + 1, md, e);
  seg[id] = seg[2 * id] + seg[2 * id + 1];
}
int get(int id = 1, int s = 0, int e = n) {
  if (seg[id] == 0 || e - s < 2) return s;
  shift(id, s, e);
  int md = (s + e) / 2;
  if (seg[2 * id] == md - s)
    return get(2 * id + 1, md, e);
  else
    return get(2 * id, s, md);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int q;
  cin >> q;
  vector<long long> v;
  v.push_back(0);
  for (int i = 0; i < q; i++) {
    cin >> qt[i] >> ql[i] >> qr[i];
    ql[i]--;
    v.push_back(ql[i]);
    v.push_back(qr[i]);
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  n = (int)(v.size());
  for (int i = 0; i < q; i++) {
    int t = qt[i];
    int l = lower_bound(v.begin(), v.end(), ql[i]) - v.begin();
    int r = lower_bound(v.begin(), v.end(), qr[i]) - v.begin();
    update(l, r, t);
    int idx = get();
    cout << v[idx] + 1 << "\n";
  }
  return 0;
}
