#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
const int maxn = 524288, maxt = 123456;
int op[maxt], F[maxn * 2], S[maxn * 2];
long long X[maxn], Y[maxt], Z[maxt], L[maxn * 2], R[maxn * 2], SIZ[maxn * 2];
map<long long, int> W;
inline long long read() {
  register char c;
  long long res = 0;
  while (c = getchar(), c < '0' || c > '9')
    ;
  do {
    res = (res << 1) + (res << 3) + (c ^ 48);
  } while (c = getchar(), c >= '0' && c <= '9');
  return res;
}
void build(int rt) {
  if (rt >= maxn) return;
  build(rt << 1);
  build(rt << 1 | 1);
  L[rt] = L[rt << 1];
  R[rt] = R[rt << 1] + R[rt << 1 | 1];
}
void pushdown(int rt) {
  if (S[rt]) {
    if (~(S[rt << 1] = S[rt << 1 | 1] = S[rt])) {
      SIZ[rt << 1] = R[rt << 1];
      SIZ[rt << 1 | 1] = R[rt << 1 | 1];
    } else
      SIZ[rt << 1] = SIZ[rt << 1 | 1] = 0;
    F[rt << 1] = F[rt << 1 | 1] = S[rt] = 0;
  } else if (F[rt]) {
    F[rt] = 0;
    if (F[rt << 1])
      F[rt << 1] = 0;
    else if (S[rt << 1])
      S[rt << 1] = -S[rt << 1];
    else
      F[rt << 1] = 1;
    SIZ[rt << 1] = R[rt << 1] - SIZ[rt << 1];
    if (F[rt << 1 | 1])
      F[rt << 1 | 1] = 0;
    else if (S[rt << 1 | 1])
      S[rt << 1 | 1] = -S[rt << 1 | 1];
    else
      F[rt << 1 | 1] = 1;
    SIZ[rt << 1 | 1] = R[rt << 1 | 1] - SIZ[rt << 1 | 1];
  }
}
void sett(int l, int r, int _l, int _r, int rt, int setx) {
  if (_l >= l && _r <= r) {
    F[rt] = 0;
    S[rt] = setx;
    SIZ[rt] = ~setx ? R[rt] : 0;
    return;
  }
  int mid = (_l + _r) >> 1;
  pushdown(rt);
  if (mid >= l) sett(l, r, _l, mid, rt << 1, setx);
  if (mid < r) sett(l, r, mid + 1, _r, rt << 1 | 1, setx);
  SIZ[rt] = SIZ[rt << 1] + SIZ[rt << 1 | 1];
  return;
}
void flip(int l, int r, int _l, int _r, int rt) {
  if (_l >= l && _r <= r) {
    if (F[rt])
      F[rt] = 0;
    else if (S[rt])
      S[rt] = -S[rt];
    else
      F[rt] = 1;
    SIZ[rt] = R[rt] - SIZ[rt];
    return;
  }
  int mid = (_l + _r) >> 1;
  pushdown(rt);
  if (mid >= l) flip(l, r, _l, mid, rt << 1);
  if (mid < r) flip(l, r, mid + 1, _r, rt << 1 | 1);
  SIZ[rt] = SIZ[rt << 1] + SIZ[rt << 1 | 1];
  return;
}
inline long long query() {
  int i = 1;
  for (; i < maxn;) {
    pushdown(i);
    i <<= 1;
    if (SIZ[i] == R[i]) i++;
  }
  return L[i];
}
int main() {
  int T, j = maxn;
  scanf("%d", &T);
  for (int i = 0; i < T; i++) {
    scanf("%d", op + i);
    X[i << 1] = Y[i] = read();
    X[i << 1 | 1] = Z[i] = read();
  }
  X[T << 1] = 1 + (long long)1e18;
  sort(X, X + 2 * T + 1);
  if (*X - 1) {
    for (int i = 1; i <= T; i++) puts("1");
    return 0;
  }
  for (int i = 0; i <= T << 1; i++) {
    if (X[i] == X[i + 1]) continue;
    L[j] = X[i];
    R[j] = 1;
    W[X[i]] = j - maxn + 1;
    j++;
    if (X[i] + 1 >= X[i + 1]) continue;
    L[j] = X[i] + 1;
    R[j] = X[i + 1] - L[j];
    j++;
  }
  build(1);
  for (int i = 0; i < T; i++) {
    if (op[i] == 1)
      sett(W[Y[i]], W[Z[i]], 1, maxn, 1, 1);
    else if (op[i] == 2)
      sett(W[Y[i]], W[Z[i]], 1, maxn, 1, -1);
    else
      flip(W[Y[i]], W[Z[i]], 1, maxn, 1);
    printf("%I64d\n", query());
  }
  return 0;
}
