#include <bits/stdc++.h>
using namespace std;
template <class BidirIt>
BidirIt prev(BidirIt it,
             typename iterator_traits<BidirIt>::difference_type n = 1) {
  advance(it, -n);
  return it;
}
template <class ForwardIt>
ForwardIt next(ForwardIt it,
               typename iterator_traits<ForwardIt>::difference_type n = 1) {
  advance(it, n);
  return it;
}
const double EPS = 1e-9;
const double PI = 3.141592653589793238462;
template <typename T>
inline T sq(T a) {
  return a * a;
}
const int MAXM = 1e5 + 5;
int x[MAXM], st[MAXM << 2], lazy[MAXM << 2];
void push(int p, int L, int R) {
  if (lazy[p] != 0) {
    st[p] += lazy[p];
    if (L != R) {
      lazy[p << 1] += lazy[p];
      lazy[p << 1 | 1] += lazy[p];
    }
    lazy[p] = 0;
  }
}
void update(int p, int L, int R, int i, int j, int val) {
  push(p, L, R);
  if (i > R || j < L) return;
  if (i <= L && j >= R) {
    lazy[p] += val;
    return push(p, L, R);
  }
  int mid = (L + R) >> 1, left = p << 1, right = left | 1;
  update(left, L, mid, i, j, val);
  update(right, mid + 1, R, i, j, val);
  st[p] = max(st[left], st[right]);
}
inline int query(int p, int L, int R) {
  while (L != R) {
    int mid = (L + R) >> 1, left = p << 1, right = left | 1;
    push(p, L, R);
    push(left, L, mid);
    push(right, mid + 1, R);
    if (st[right] > 0) {
      L = mid + 1;
      p = right;
    } else {
      R = mid;
      p = left;
    }
  }
  return x[R];
}
int main() {
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int p, t;
    scanf("%d %d", &p, &t);
    if (t == 1) scanf("%d", &x[p]);
    update(1, 1, m, 1, p, (t == 1 ? 1 : -1));
    printf("%d\n", st[1] > 0 ? query(1, 1, m) : -1);
  }
  return 0;
}
