#include <bits/stdc++.h>
const long long MAXL = 1e18;
struct node {
  int t;
  long long l, r;
} query[(1 << 18) + 10];
int n;
int sum[((1 << 18) << 1) + 10], lazy[((1 << 18) << 1) + 10];
long long ans[(1 << 18) + 10];
std::vector<long long> vec;
int trans[4][4] = {{0, 1, 2, 3}, {1, 1, 2, 2}, {2, 1, 2, 1}, {3, 1, 2, 0}};
void modify(int u, int l, int r, int v) {
  switch (v) {
    case 1:
      sum[u] = r - l + 1;
      break;
    case 2:
      sum[u] = 0;
      break;
    case 3:
      sum[u] = r - l + 1 - sum[u];
      break;
  }
  lazy[u] = trans[lazy[u]][v];
}
void pushdown(int u, int l, int r) {
  if (!lazy[u]) return;
  int m = l + r >> 1, ls = u << 1, rs = ls | 1;
  modify(ls, l, m, lazy[u]);
  modify(rs, m + 1, r, lazy[u]);
  lazy[u] = 0;
}
void insert(int u, int l, int r, int ql, int qr, int v) {
  if (ql <= l && r <= qr) {
    modify(u, l, r, v);
    return;
  }
  pushdown(u, l, r);
  int m = l + r >> 1, ls = u << 1, rs = ls | 1;
  if (!(m < ql)) insert(ls, l, m, ql, qr, v);
  if (!(qr < m + 1)) insert(rs, m + 1, r, ql, qr, v);
  sum[u] = sum[ls] + sum[rs];
}
int find(int u, int l, int r) {
  if (l == r) return l;
  pushdown(u, l, r);
  int m = l + r >> 1, ls = u << 1, rs = ls | 1;
  if (sum[ls] != (m - l + 1)) return find(ls, l, m);
  return find(rs, m + 1, r);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%I64d%I64d", &query[i].t, &query[i].l, &query[i].r);
    ++query[i].r;
    vec.push_back(query[i].l);
    vec.push_back(query[i].r);
  }
  vec.push_back(1);
  vec.push_back(MAXL + 1);
  std::sort(vec.begin(), vec.end());
  vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
  for (int i = 0, sz = (int)(vec.size()); i < sz; ++i) {
    ans[i + 1] = vec[i];
  }
  for (int i = (int)(vec.size()) + 1; i <= (1 << 18); ++i) {
    ans[i] = MAXL + 1;
  }
  for (int i = 1; i <= n; ++i) {
    int t = query[i].t;
    int l =
        std::lower_bound(vec.begin(), vec.end(), query[i].l) - vec.begin() + 1;
    int r = std::lower_bound(vec.begin(), vec.end(), query[i].r) - vec.begin();
    insert(1, 1, (1 << 18), l, r, t);
    printf("%I64d\n", ans[find(1, 1, (1 << 18))]);
  }
  return 0;
}
