#include <bits/stdc++.h>
int faster_in() {
  int r = 0, c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') return -faster_in();
  for (; c > 32; r = (r << 1) + (r << 3) + c - '0', c = getchar())
    ;
  return r;
}
using namespace std;
const int INF = 1234567890;
const int tam = 1e5 + 10;
int valor[tam];
int T[4 * tam], lazy[4 * tam];
void propagate(int b, int e, int nodo) {
  int L = 2 * nodo + 1, R = L + 1, mid = (b + e) / 2;
  ;
  if (lazy[nodo] == 0) return;
  T[nodo] += lazy[nodo];
  if (b != e) {
    lazy[L] += lazy[nodo];
    lazy[R] += lazy[nodo];
  }
  lazy[nodo] = 0;
}
void update(int b, int e, int nodo, int i, int j, int val) {
  int L = 2 * nodo + 1, R = L + 1, mid = (b + e) / 2;
  ;
  propagate(b, e, nodo);
  if (j < b || e < i) return;
  if (i <= b && e <= j) {
    lazy[nodo] += val;
    propagate(b, e, nodo);
    return;
  }
  update(b, mid, L, i, j, val);
  update(mid + 1, e, R, i, j, val);
  T[nodo] = max(T[L], T[R]);
}
int query(int b, int e, int nodo, int i, int j) {
  int L = 2 * nodo + 1, R = L + 1, mid = (b + e) / 2;
  ;
  propagate(b, e, nodo);
  if (j < b || e < i) return -INF;
  if (i <= b && e <= j) return T[nodo];
  return max(query(b, mid, L, i, j), query(mid + 1, e, R, i, j));
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = (int)0; i < (int)n; ++i) {
    int p, t;
    cin >> p >> t;
    p = n - p;
    if (t == 0) {
      update(0, n - 1, 0, p, n - 1, -1);
    } else {
      cin >> valor[p];
      update(0, n - 1, 0, p, n - 1, 1);
    }
    int lo = 0, hi = n - 1, mid, res = -1;
    while (lo <= hi) {
      mid = (lo + hi) / 2;
      int q = query(0, n - 1, 0, 0, mid);
      if (q > 0) {
        res = mid;
        hi = mid - 1;
      } else {
        lo = mid + 1;
      }
    }
    if (res == -1)
      cout << -1 << '\n';
    else
      cout << valor[res] << '\n';
  }
  return 0;
}
