#include <bits/stdc++.h>
using namespace std;
const int N = 100006;
const int nein = -1;
struct qr {
  long long o, l, r;
};
vector<long long> vals;
vector<qr> q;
struct Segment_Tree {
  vector<int> val, lazy;
  int size;
  void init(int x) {
    size = 1;
    while (size < x) size *= 2;
    val.resize(size * 2);
    lazy.resize(size * 2);
  }
  void propagate(int node, int l, int r) {
    if (l == r - 1) {
      lazy[node] = nein;
      return;
    }
    if (lazy[node] == nein) {
      return;
    }
    int mid = (l + r) / 2;
    for (int x : {2 * node + 1, 2 * node + 2}) {
      if (lazy[node] == 0) {
        val[x] = 0;
        lazy[x] = 0;
      }
      if (lazy[node] == 1) {
        val[x] = mid - l;
        lazy[x] = 1;
      }
      if (lazy[node] == 2) {
        val[x] = mid - l - val[x];
        lazy[x] = 1 - lazy[x];
      }
    }
    lazy[node] = nein;
  }
  int merge(int a, int b) { return a + b; }
  void add(int node, int l, int r, int lf, int rg, int x) {
    propagate(node, l, r);
    if (r <= lf || l >= rg) return;
    if (l >= lf && r <= rg) {
      val[node] = x * (r - l);
      lazy[node] = x;
      return;
    }
    int mid = (l + r) / 2;
    add(node * 2 + 1, l, mid, lf, rg, x);
    add(node * 2 + 2, mid, r, lf, rg, x);
    val[node] = merge(val[node * 2 + 1], val[node * 2 + 2]);
  }
  void add(int l, int r, int x) { add(0, 0, size, l, r, x); }
  void rev(int node, int l, int r, int lf, int rg) {
    propagate(node, l, r);
    if (r <= lf || l >= rg) return;
    if (l >= lf && r <= rg) {
      val[node] = r - l - val[node];
      if (lazy[node] == -1)
        lazy[node] = 2;
      else
        lazy[node] = 1 - lazy[node];
      return;
    }
    int mid = (l + r) / 2;
    rev(node * 2 + 1, l, mid, lf, rg);
    rev(node * 2 + 2, mid, r, lf, rg);
    val[node] = merge(val[node * 2 + 1], val[node * 2 + 2]);
  }
  void rev(int l, int r) { rev(0, 0, size, l, r); }
  int get(int node, int l, int r) {
    propagate(node, l, r);
    if (val[node] == r - l) return -1;
    if (l == r - 1) {
      return l;
    }
    int mid = (l + r) / 2;
    int ans = get(node * 2 + 1, l, mid);
    if (ans == -1) ans = get(node * 2 + 2, mid, r);
    return ans;
  }
  int get() { return get(0, 0, size); }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    long long op, x, y;
    cin >> op >> x >> y;
    q.push_back(qr{op, x, y});
    vals.push_back(x);
    vals.push_back(y);
    vals.push_back(y + 1);
  }
  vals.push_back(1);
  sort(vals.begin(), vals.end());
  vals.erase(unique(vals.begin(), vals.end()), vals.end());
  for (int i = 1; i <= n; i++) {
    q[i - 1].l =
        lower_bound(vals.begin(), vals.end(), q[i - 1].l) - vals.begin();
    q[i - 1].r =
        lower_bound(vals.begin(), vals.end(), q[i - 1].r) - vals.begin();
  }
  Segment_Tree st;
  st.init(6 * n);
  for (auto it : q) {
    if (it.o == 1) {
      st.add(it.l, it.r + 1, 1);
    } else if (it.o == 2) {
      st.add(it.l, it.r + 1, 0);
    } else if (it.o == 3) {
      st.rev(it.l, it.r + 1);
    }
    cout << vals[st.get()] << '\n';
  }
  return 0;
}
