#include <bits/stdc++.h>
using namespace std;
long long f[8 * 500005], tag[8 * 500005], sz;
void dolazy(long long k, long long l, long long r) {
  if (tag[k] == 0) return;
  if (tag[k] == 1) f[k] = r - l + 1;
  if (tag[k] == 2) f[k] = 0;
  if (tag[k] == 3) f[k] = (r - l + 1) - f[k];
  if (l != r) {
    if (tag[k] <= 2)
      tag[k << 1] = tag[(k << 1) + 1] = tag[k];
    else {
      if (tag[k << 1] <= 2)
        tag[k << 1] = 3 - tag[k << 1];
      else
        tag[k << 1] = 0;
      if (tag[(k << 1) | 1] <= 2)
        tag[(k << 1) | 1] = 3 - tag[(k << 1) | 1];
      else
        tag[(k << 1) | 1] = 0;
    }
  }
  tag[k] = 0;
}
void update(long long k, long long l, long long r, long long L, long long R,
            long long opt) {
  dolazy(k, l, r);
  if (l > R || r < L || l > r) return;
  if (L <= l && r <= R) {
    if (opt == 1) f[k] = r - l + 1;
    if (opt == 2) f[k] = 0;
    if (opt == 3) f[k] = (r - l + 1) - f[k];
    if (l != r) {
      if (opt <= 2)
        tag[k << 1] = tag[(k << 1) | 1] = opt;
      else {
        if (tag[k << 1] <= 2)
          tag[k << 1] = 3 - tag[k << 1];
        else
          tag[k << 1] = 0;
        if (tag[(k << 1) | 1] <= 2)
          tag[(k << 1) | 1] = 3 - tag[(k << 1) | 1];
        else
          tag[(k << 1) | 1] = 0;
      }
    }
    return;
  }
  long long mid = (l + r) >> 1;
  update(k << 1, l, mid, L, R, opt);
  update((k << 1) | 1, mid + 1, r, L, R, opt);
  f[k] = f[k << 1] + f[(k << 1) | 1];
}
long long get(long long k, long long l, long long r) {
  dolazy(k, l, r);
  if (l == r) return l;
  long long mid = (l + r) >> 1;
  dolazy(k << 1, l, mid);
  if (f[k << 1] == (mid - l + 1)) return get((k << 1) | 1, mid + 1, r);
  return get(k << 1, l, mid);
}
long long n, L[500005], R[500005], type[500005], val[500005];
set<long long> ok;
map<long long, long long> pos;
void init() {
  ok.insert(1);
  sz = ok.size();
  long long i = 1;
  for (set<long long>::iterator it = ok.begin(); it != ok.end(); it++) {
    val[i] = *it;
    i++;
  }
  i = 1;
  for (; i <= sz; i++) pos[val[i]] = i;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> type[i] >> L[i] >> R[i];
    ok.insert(L[i]);
    ok.insert(L[i] + 1);
    ok.insert(R[i]);
    ok.insert(R[i] + 1);
  }
  init();
  for (long long i = 1; i <= n; i++) {
    update(1, 1, sz, pos[L[i]], pos[R[i]], type[i]);
    cout << val[get(1, 1, sz)] << endl;
  }
  return 0;
}
