#include <bits/stdc++.h>
using namespace std;
const int inf = 1.01e9;
const double eps = 1e-9;
const int N = 1 << 17;
pair<int, int> t[2 * N];
int a[N];
int ans = -1;
void upd(int x, pair<int, int> v) {
  x += N;
  t[x] = v;
  while (x > 1) {
    x >>= 1;
    t[x].first = max(t[2 * x].first,
                     t[2 * x].first - t[2 * x].second + t[2 * x + 1].first);
    t[x].second =
        max(0, t[2 * x].second - t[2 * x + 1].first) + t[2 * x + 1].second;
  }
  if (t[x].second == 0) {
    ans = -1;
  } else {
    int cnt = t[x].second;
    while (x < N) {
      int FS = max(0, t[2 * x].second - t[2 * x + 1].first);
      if (cnt <= FS) {
        x = 2 * x;
      } else {
        cnt -= FS;
        x = 2 * x + 1;
      }
    }
    ans = a[x - N];
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; (i) < (n); ++i) {
    int pos, tp;
    scanf("%d%d", &pos, &tp);
    if (tp == 0) {
      upd(pos, {1, 0});
    } else {
      int x;
      scanf("%d", &x);
      a[pos] = x;
      upd(pos, {0, 1});
    }
    printf("%d\n", ans);
  }
  return 0;
}
