#include <bits/stdc++.h>
using namespace std;
map<long long, int> ma;
long long a[300005], q[100005][3], dict[300005];
int n, sum[300005 << 2], top, tag[300005 << 2], tot;
bool rev[300005 << 2];
void push_up(int p) { sum[p] = sum[(p << 1)] + sum[(p << 1 | 1)]; }
void opt1(int p, int l, int r, int k) {
  if (k == -1) return;
  sum[p] = (r - l + 1) * k;
  tag[p] = k;
  rev[p] = 0;
}
void opt2(int p, int l, int r) {
  sum[p] = (r - l + 1) - sum[p];
  if (tag[p] != -1)
    tag[p] = !tag[p];
  else
    rev[p] = !rev[p];
}
void push_down(int p, int l, int r) {
  if (tag[p] == -1 && !rev[p]) return;
  int mid = (l + r) >> 1;
  opt1((p << 1), l, mid, tag[p]);
  opt1((p << 1 | 1), mid + 1, r, tag[p]);
  tag[p] = -1;
  if (rev[p])
    opt2((p << 1), l, mid), opt2((p << 1 | 1), mid + 1, r), rev[p] = false;
}
void update(int nl, int nr, int l, int r, int p, int k) {
  if (nl <= l && r <= nr) {
    opt1(p, l, r, k);
    return;
  }
  push_down(p, l, r);
  int mid = (l + r) >> 1;
  if (nl <= mid) update(nl, nr, l, mid, (p << 1), k);
  if (nr > mid) update(nl, nr, mid + 1, r, (p << 1 | 1), k);
  push_up(p);
}
void update_rev(int nl, int nr, int l, int r, int p) {
  if (nl <= l && r <= nr) {
    opt2(p, l, r);
    return;
  }
  push_down(p, l, r);
  int mid = (l + r) >> 1;
  if (nl <= mid) update_rev(nl, nr, l, mid, (p << 1));
  if (nr > mid) update_rev(nl, nr, mid + 1, r, (p << 1 | 1));
  push_up(p);
}
int query(int p, int l, int r) {
  if (!sum[p]) return l;
  int mid = (l + r) >> 1;
  push_down(p, l, r);
  if (sum[(p << 1)] == mid - l + 1)
    return query((p << 1 | 1), mid + 1, r);
  else
    return query((p << 1), l, mid);
}
int main() {
  memset(tag, -1, sizeof(tag));
  cin >> n;
  a[++top] = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld%lld", &q[i][0], &q[i][1], &q[i][2]);
    a[++top] = q[i][1], a[++top] = q[i][2], a[++top] = q[i][2] + 1;
  }
  sort(a + 1, a + 1 + top);
  for (int i = 1; i <= top; i++) {
    if (a[i] != a[i - 1]) ma[a[i]] = ++tot, dict[tot] = a[i];
  }
  for (int i = 1; i <= n; i++) {
    q[i][1] = ma[q[i][1]];
    q[i][2] = ma[q[i][2]];
    if (q[i][0] == 1)
      update(q[i][1], q[i][2], 1, tot, 1, 1);
    else if (q[i][0] == 2)
      update(q[i][1], q[i][2], 1, tot, 1, 0);
    else if (q[i][0] == 3)
      update_rev(q[i][1], q[i][2], 1, tot, 1);
    printf("%lld\n", dict[query(1, 1, tot)]);
  }
  return 0;
}
