#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1073741824")
using namespace std;
struct Q {
  long long int t, l, r;
  Q(long long int t, long long int l, long long int r) : t(t), l(l), r(r) {}
};
vector<Q> qv;
vector<long long int> vb;
const int MAXN = 2e5 + 100;
int t[MAXN * 4], up[MAXN * 4];
void push(int v, int L, int R) {
  if (up[v] != -1) {
    int m = (L + R) >> 1;
    if (L < R) {
      if (up[v] == 0 || up[v] == 1)
        up[v * 2] = up[v * 2 + 1] = up[v];
      else {
        if (up[v * 2] == 0 || up[v * 2] == 1)
          up[v * 2] = 1 - up[v * 2];
        else if (up[v * 2] == 2)
          up[v * 2] = -1;
        else
          up[v * 2] = 2;
        if (up[v * 2 + 1] == 0 || up[v * 2 + 1] == 1)
          up[v * 2 + 1] = 1 - up[v * 2 + 1];
        else if (up[v * 2 + 1] == 2)
          up[v * 2 + 1] = -1;
        else
          up[v * 2 + 1] = 2;
      }
    }
    if (up[v] == 0)
      t[v] = R - L + 1;
    else if (up[v] == 1)
      t[v] = 0;
    else
      t[v] = R - L + 1 - t[v];
    up[v] = -1;
  }
}
void update(int l, int r, int x, int v, int L, int R) {
  if (l > R || r < L) return;
  if (l == L && r == R) {
    up[v] = x;
    push(v, L, R);
  } else {
    int m = (L + R) >> 1;
    push(v, L, R);
    push(v * 2, L, m);
    push(v * 2 + 1, m + 1, R);
    update(l, min(m, r), x, v * 2, L, m);
    update(max(l, m + 1), r, x, v * 2 + 1, m + 1, R);
    t[v] = t[v * 2] + t[v * 2 + 1];
  }
}
long long int query(int v, int L, int R) {
  if (L == R) {
    return vb[L];
  } else {
    int m = (L + R) >> 1;
    push(v, L, R);
    push(v * 2, L, m);
    push(v * 2 + 1, m + 1, R);
    if (t[v * 2] < m - L + 1)
      return query(v * 2, L, m);
    else
      return query(v * 2 + 1, m + 1, R);
  }
}
int main() {
#pragma warning(disable : 4996)
  int n;
  scanf("%d", &n);
  memset(up, 255, sizeof(up));
  ;
  for (int i = 0; i < n; i++) {
    long long int t, l, r;
    scanf("%lld%lld%lld", &t, &l, &r);
    qv.push_back(Q(t - 1, l, r));
    vb.push_back(l);
    vb.push_back(r + 1);
  }
  vb.push_back(1);
  sort(vb.begin(), vb.end());
  vb.push_back(vb.back() + 1);
  vb.erase(unique(vb.begin(), vb.end()), vb.end());
  for (int i = 0; i < n; i++) {
    auto l = lower_bound(vb.begin(), vb.end(), qv[i].l),
         r = lower_bound(vb.begin(), vb.end(), qv[i].r);
    if (*r > qv[i].r) r--;
    update(l - vb.begin(), r - vb.begin(), qv[i].t, 1, 0, vb.size() - 1);
    printf("%lld\n", query(1, 0, vb.size() - 1));
  }
  return 0;
}
