#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 19;
const int NN = N * 2;
int A[NN];
bool lazy[NN][3];
void push_lazy(int v, int l, int r) {
  if (lazy[v][0]) {
    A[v] = 0;
    if (v < N) {
      lazy[2 * v][0] = lazy[2 * v + 1][0] = 1;
      lazy[2 * v][1] = lazy[2 * v + 1][1] = lazy[2 * v][2] =
          lazy[2 * v + 1][2] = 0;
    }
    lazy[v][0] = 0;
  }
  if (lazy[v][1]) {
    A[v] = r - l + 1;
    if (v < N) {
      lazy[2 * v][0] = lazy[2 * v + 1][0] = lazy[2 * v][2] =
          lazy[2 * v + 1][2] = 0;
      lazy[2 * v][1] = lazy[2 * v + 1][1] = 1;
    }
    lazy[v][1] = 0;
  }
  if (lazy[v][2]) {
    A[v] = r - l + 1 - A[v];
    if (v < N) {
      lazy[2 * v][2] ^= 1;
      lazy[2 * v + 1][2] ^= 1;
    }
    lazy[v][2] = 0;
  }
}
int query(int v, int l, int r) {
  if (v >= N) return v - N;
  push_lazy(v, l, r);
  const int m = (l + r) / 2;
  push_lazy(2 * v, l, m);
  if (A[2 * v] < m - l + 1)
    return query(2 * v, l, m);
  else
    return query(2 * v + 1, m + 1, r);
}
void update(int v, int ql, int qr, int l, int r, int ty) {
  push_lazy(v, l, r);
  if (ql == l && qr == r) {
    lazy[v][ty] = 1;
    push_lazy(v, l, r);
    return;
  }
  const int m = (l + r) / 2;
  if (ql <= m)
    update(2 * v, ql, min(qr, m), l, m, ty);
  else
    push_lazy(2 * v, l, m);
  if (qr > m)
    update(2 * v + 1, max(m + 1, ql), qr, m + 1, r, ty);
  else
    push_lazy(2 * v + 1, m + 1, r);
  A[v] = A[2 * v] + A[2 * v + 1];
}
void rem(int l, int r) { update(1, l, r, 0, N - 1, 0); }
void add(int l, int r) { update(1, l, r, 0, N - 1, 1); }
void flp(int l, int r) { update(1, l, r, 0, N - 1, 2); }
int mex() { return query(1, 0, N - 1); }
vector<long long> coords;
long long inp[100000][3];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  coords.push_back(1);
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    for (int j = 0; j < 3; j++) cin >> inp[i][j];
    coords.push_back(inp[i][1]);
    coords.push_back(inp[i][2]);
    coords.push_back(inp[i][2] + 1);
  }
  sort(coords.begin(), coords.end());
  coords.erase(unique(coords.begin(), coords.end()), coords.end());
  for (int i = 0; i < q; i++) {
    int t = inp[i][0],
        l = distance(coords.begin(),
                     lower_bound(coords.begin(), coords.end(), inp[i][1])),
        r = distance(coords.begin(),
                     lower_bound(coords.begin(), coords.end(), inp[i][2]));
    if (t == 1) add(l, r);
    if (t == 2) rem(l, r);
    if (t == 3) flp(l, r);
    cout << coords[mex()] << '\n';
  }
  return 0;
}
