#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long maxn = 1e6;
const long long mod = 1e9 + 7;
const long double PI = acos((long double)-1);
long long pw(long long a, long long b, long long md = mod) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = (a * res) % md;
    }
    a = (a * a) % md;
    b >>= 1;
  }
  return (res);
}
long long n;
long long t[maxn], l[maxn], r[maxn];
vector<long long> vec;
struct segment {
  vector<long long> seg, lazy;
  segment(long long x) : seg(maxn * 4, 0), lazy(maxn * 4, -1) {}
  void shift(long long v, long long l, long long r) {
    if (lazy[v] == -1) return;
    if (lazy[v] == 1) seg[v] = r - l;
    if (lazy[v] == 0) seg[v] = 0;
    if (lazy[v] == 2) seg[v] = r - l - seg[v];
    if (r - l > 1) {
      if (lazy[v] == 2) {
        if (lazy[2 * v] == 2) {
          lazy[2 * v] = -1;
        } else if (lazy[2 * v] == 0) {
          lazy[2 * v] = 1;
        } else if (lazy[2 * v] == 1) {
          lazy[2 * v] = 0;
        } else {
          lazy[2 * v] = 2;
        }
        if (lazy[2 * v + 1] == 2) {
          lazy[2 * v + 1] = -1;
        } else if (lazy[2 * v + 1] == 0) {
          lazy[2 * v + 1] = 1;
        } else if (lazy[2 * v + 1] == 1) {
          lazy[2 * v + 1] = 0;
        } else {
          lazy[2 * v + 1] = 2;
        }
      } else
        lazy[2 * v + 1] = lazy[2 * v] = lazy[v];
    }
    lazy[v] = -1;
  }
  void update(long long x, long long L, long long R, long long v = 1,
              long long l = 1, long long r = maxn) {
    shift(v, l, r);
    if (r <= L or R <= l) return;
    if (L <= l and r <= R) {
      lazy[v] = x;
      shift(v, l, r);
      return;
    }
    long long mid = (l + r) / 2;
    update(x, L, R, 2 * v, l, mid);
    update(x, L, R, 2 * v + 1, mid, r);
    seg[v] = seg[2 * v] + seg[2 * v + 1];
  }
  void solve(long long v = 1, long long l = 1, long long r = maxn) {
    shift(v, l, r);
    if (r - l == 1) {
      cout << vec[l - 1] << '\n';
      return;
    }
    long long mid = (r + l) / 2;
    shift(2 * v, l, mid);
    if (seg[2 * v] == mid - l) {
      solve(2 * v + 1, mid, r);
    } else {
      solve(2 * v, l, mid);
    }
  }
};
segment seg(2);
long long comp(long long x) {
  return (lower_bound(vec.begin(), vec.end(), x) - vec.begin() + 1);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++)
    cin >> t[i] >> l[i] >> r[i], vec.push_back(l[i]), vec.push_back(r[i] + 1),
        vec.push_back(r[i]);
  vec.push_back(1);
  vec.push_back(1000000000000000001);
  sort(vec.begin(), vec.end());
  vec.resize(unique(vec.begin(), vec.end()) - vec.begin());
  for (long long i = 0; i < n; i++) {
    if (t[i] == 1) {
      seg.update(1, comp(l[i]), comp(r[i] + 1));
    }
    if (t[i] == 2) {
      seg.update(0, comp(l[i]), comp(r[i] + 1));
    }
    if (t[i] == 3) {
      seg.update(2, comp(l[i]), comp(r[i] + 1));
    }
    seg.solve();
  }
  return (0);
}
