#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const long long linf = 1ll << 60;
const double dinf = 1e10;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
template <typename T1, typename T2, typename T3, typename T4>
void scf(T1 &x, T2 &y, T3 &z, T4 &w) {
  scf(x);
  scf(y);
  scf(z);
  return scf(w);
}
const int N = 1e5 + 100;
int n;
namespace seg {
int num[N << 2], lazy[N << 2];
int L(int i) { return i << 1; }
int R(int i) { return (i << 1) | 1; }
void pull(int i) { num[i] = max(num[L(i)], num[R(i)]); }
void push(int i) {
  if (lazy[i]) {
    int l = L(i), r = R(i);
    lazy[l] += lazy[i];
    num[l] += lazy[i];
    lazy[r] += lazy[i];
    num[r] += lazy[i];
    lazy[i] = 0;
  }
}
void modify(int a, int b, int x, int l = 1, int r = n, int k = 1) {
  if (a == l && b == r) {
    num[k] += x;
    lazy[k] += x;
    return;
  }
  int mid = l + r >> 1;
  push(k);
  if (a > mid)
    modify(a, b, x, mid + 1, r, R(k));
  else if (b <= mid)
    modify(a, b, x, l, mid, L(k));
  else
    modify(a, mid, x, l, mid, L(k)), modify(mid + 1, b, x, mid + 1, r, R(k));
  pull(k);
}
int query(int a, int b, int l = 1, int r = n, int k = 1) {
  if (a == l && b == r) return num[k];
  int mid = l + r >> 1;
  push(k);
  if (a > mid) return query(a, b, mid + 1, r, R(k));
  if (b <= mid) return query(a, b, l, mid, L(k));
  return max(query(a, mid, l, mid, L(k)), query(mid + 1, b, mid + 1, r, R(k)));
}
}  // namespace seg
int x[N];
void qry() {
  int l = 1, r = n;
  while (l <= r) {
    int mid = l + r >> 1;
    int t = seg::query(mid, n);
    if (t > 0)
      l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d\n", x[r]);
  return;
}
int main() {
  x[0] = -1;
  scf(n);
  for (int i = (1); i <= (n); i++) {
    int p, t;
    scf(p, t);
    if (t == 1) scf(x[p]);
    seg::modify(1, p, (t ? 1 : -1));
    qry();
  }
  return 0;
}
