#include <bits/stdc++.h>
const long long INF = (long long)1e18 + 123;
const int inf = (int)2e9 + 123;
const int mod = 1e9 + 7;
using namespace std;
int n;
int t[7000011], k[7000011], rev[7000011];
void push(int v, int tl, int tr) {
  if (k[v] == 0 && rev[v] == 0) return;
  if (k[v] == 2)
    t[v] = (tr - tl + 1);
  else if (k[v] == 1)
    t[v] = 0;
  if (rev[v]) t[v] = tr - tl + 1 - t[v];
  if (k[v]) {
    rev[v * 2] = rev[v * 2 + 1] = 0;
    k[v * 2] = k[v * 2 + 1] = k[v];
  }
  if (rev[v]) {
    rev[v * 2] ^= 1;
    rev[v * 2 + 1] ^= 1;
  }
  k[v] = rev[v] = 0;
}
void upd(int l, int r, int x, int v = 1, int tl = 1, int tr = 200012) {
  push(v, tl, tr);
  if (tl > r || tr < l || tl > tr || l > r) return;
  if (tl >= l && tr <= r) {
    if (x <= 2) {
      k[v] = x;
      rev[v] = 0;
    } else
      rev[v] ^= 1;
    push(v, tl, tr);
    return;
  }
  int mid = (tl + tr) / 2;
  upd(l, r, x, v * 2, tl, mid);
  upd(l, r, x, v * 2 + 1, mid + 1, tr);
  t[v] = t[v * 2] + t[v * 2 + 1];
}
int get(int v = 1, int tl = 1, int tr = 200012) {
  push(v, tl, tr);
  if (tl == tr) return tl;
  int mid = (tl + tr) / 2;
  push(v * 2, tl, mid);
  push(v * 2 + 1, mid + 1, tr);
  if (t[v * 2] < mid - tl + 1) {
    return get(v * 2, tl, mid);
  } else
    return get(v * 2 + 1, mid + 1, tr);
}
int q;
map<long long, long long> f;
vector<long long> g;
long long id[200015];
long long type[100011], l[100011], r[100011];
int main() {
  unsigned int FOR;
  asm("rdtsc" : "=A"(FOR));
  srand(FOR);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> q;
  for (int i = 1; i <= q; i++) {
    cin >> type[i] >> l[i] >> r[i];
    g.push_back(l[i]);
    g.push_back(r[i] + 1);
  }
  g.push_back(1);
  sort(g.begin(), g.end());
  int pos = 0;
  for (int i = 0; i < g.size(); i++) {
    if (i == 0 || g[i] != g[i - 1]) {
      f[g[i]] = ++pos;
      id[pos] = g[i];
    }
  }
  for (int i = 1; i <= q; i++) {
    l[i] = f[l[i]];
    r[i] = max(l[i], f[r[i] + 1] - 1);
    if (type[i] == 1) {
      upd(l[i], r[i], 2);
    } else if (type[i] == 2) {
      upd(l[i], r[i], 1);
    } else {
      upd(l[i], r[i], 3);
    }
    cout << id[get()] << endl;
  }
  return 0;
}
