#include <bits/stdc++.h>
using namespace std;
int N;
struct SegNode {
  int val, lazy;
  SegNode *right;
  SegNode *left;
  SegNode() {
    val = 0;
    lazy = -1;
    right = left = NULL;
  }
};
inline bool get_val(SegNode *&node) {
  if (node && node->lazy + 1) node->val = node->lazy;
  return (!node || !node->val);
}
void push_lazy(SegNode *&node) {
  if (node->left == NULL) node->left = new SegNode();
  if (node->right == NULL) node->right = new SegNode();
  if (node->lazy == -1) return;
  node->val = node->lazy;
  node->left->lazy = node->lazy;
  node->right->lazy = node->lazy;
  node->lazy = -1;
}
void swap(int i, int j, SegNode *&zero, SegNode *&one, int L = 1, int R = N) {
  if (zero == NULL) zero = new SegNode();
  if (one == NULL) one = new SegNode();
  push_lazy(zero);
  push_lazy(one);
  if (i > R || j < L) return;
  if (L >= i && R <= j) {
    swap(zero, one);
    return;
  }
  int mid = L + R >> 1;
  swap(i, j, zero->left, one->left, L, mid);
  swap(i, j, zero->right, one->right, mid + 1, R);
  one->val = min(one->left->val, one->right->val);
  zero->val = min(zero->left->val, zero->right->val);
}
void update(int i, int j, int val, SegNode *&node, int L = 1, int R = N) {
  if (node == NULL) node = new SegNode();
  push_lazy(node);
  if (R < i || L > j) return;
  if (L >= i && R <= j) {
    node->lazy = val;
    push_lazy(node);
    return;
  }
  int mid = L + R >> 1;
  update(i, j, val, node->left, L, mid);
  update(i, j, val, node->right, mid + 1, R);
  node->val = min(node->left->val, node->right->val);
}
int ans;
void query(SegNode *&node, int L = 1, int R = N) {
  if (node == NULL || L == R) {
    ans = L;
    return;
  }
  if (node) push_lazy(node);
  int mid = L + R >> 1;
  if (get_val(node->left))
    query(node->left, L, mid);
  else
    query(node->right, mid + 1, R);
}
int main() {
  int n;
  scanf("%d", &n);
  map<long long, int> compress;
  vector<tuple<int, long long, long long>> queries;
  for (int i = 0; i < n; i++) {
    long long t, L, R;
    scanf("%lld%lld%lld", &t, &L, &R);
    queries.push_back({t, L, R});
    compress[L];
    compress[L + 1];
    compress[max(1LL, L - 1)];
    compress[R];
    compress[R + 1];
    compress[max(1LL, R - 1)];
  }
  map<int, long long> inv;
  compress[1];
  compress[4e18];
  for (auto &[val, id] : compress) {
    id = ++N;
    inv[N] = val;
  }
  SegNode *one = NULL, *zero = NULL;
  update(1, N, 1, one);
  for (auto &[t, L, R] : queries) {
    L = compress[L], R = compress[R];
    if (t == 1) {
      update(L, R, 1, zero);
      update(L, R, 0, one);
    } else if (t == 2) {
      update(L, R, 0, zero);
      update(L, R, 1, one);
    } else {
      swap(L, R, zero, one);
    }
    query(zero);
    printf("%lld\n", inv[ans]);
  }
  return 0;
}
