#include <bits/stdc++.h>
using namespace std;
struct info {
  long long prop, MAX;
  info() { prop = 0, MAX = 0; }
} tree[100005 * 3];
int ara[100005];
void update(long long node, long long b, long long e, long long i, long long j,
            long long x) {
  if (i > e || j < b) return;
  if (b >= i && e <= j) {
    tree[node].MAX += x;
    tree[node].prop += x;
    return;
  }
  long long Left = node * 2;
  long long Right = (node * 2) + 1;
  long long mid = (b + e) / 2;
  update(Left, b, mid, i, j, x);
  update(Right, mid + 1, e, i, j, x);
  tree[node].MAX = max(tree[Left].MAX, tree[Right].MAX) + tree[node].prop;
}
long long query(long long node, long long b, long long e, long long i,
                long long j, long long carry = 0) {
  if (i > e || j < b) return -LLONG_MAX;
  if (b >= i and e <= j) return tree[node].MAX + carry;
  long long Left = node << 1;
  long long Right = (node << 1) + 1;
  long long mid = (b + e) >> 1;
  long long p1 = query(Left, b, mid, i, j, carry + tree[node].prop);
  long long p2 = query(Right, mid + 1, e, i, j, carry + tree[node].prop);
  return max(p1, p2);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int p, t;
    scanf("%d %d", &p, &t);
    p = n - p + 1;
    if (!t) {
      update(1, 1, n, p, n, -1);
    } else {
      update(1, 1, n, p, n, 1);
      int x;
      scanf("%d", &x);
      ara[p] = x;
    }
    if (query(1, 1, n, 1, n) <= 0) {
      printf("-1\n");
      continue;
    }
    int lo = 1, hi = n;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      if (query(1, 1, n, 1, mid) <= 0)
        lo = mid + 1;
      else
        hi = mid;
    }
    printf("%d\n", ara[hi]);
  }
}
