#include <bits/stdc++.h>
using namespace std;
long long int a[100005], sg[100005 * 4], lz[100005 * 4], res, x, y, z, n;
void lazy(long long int low, long long int high, long long int pos) {
  sg[pos] += lz[pos];
  if (low != high) lz[pos * 2 + 1] += lz[pos], lz[pos * 2 + 2] += lz[pos];
  lz[pos] = 0;
}
void update(long long int low, long long int high, long long int pos,
            long long int qlow, long long int qhigh, long long int va) {
  lazy(low, high, pos);
  if (qlow > high || qhigh < low) return;
  if (qlow <= low && high <= qhigh) {
    sg[pos] += va;
    if (low != high) lz[pos * 2 + 1] += va, lz[pos * 2 + 2] += va;
    return;
  }
  long long int mid = (high + low) / 2;
  update(low, mid, pos * 2 + 1, qlow, qhigh, va);
  update(mid + 1, high, pos * 2 + 2, qlow, qhigh, va);
  sg[pos] = max(sg[pos * 2 + 1], sg[pos * 2 + 2]);
}
long long int ans(long long int low, long long int high, long long int pos) {
  lazy(low, high, pos);
  if (sg[pos] <= 0) return -1;
  if (low == high) return a[low];
  long long int mid = (high + low) / 2;
  lazy(low, mid, pos * 2 + 1), lazy(mid + 1, high, pos * 2 + 2);
  if (sg[pos * 2 + 2] > 0)
    return ans(mid + 1, high, pos * 2 + 2);
  else
    return ans(low, mid, pos * 2 + 1);
}
int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld", &x, &y);
    x--;
    if (y == 0)
      y = -1;
    else
      scanf("%lld", &z), a[x] = z;
    update(0, n, 0, 0, x, y);
    res = ans(0, n, 0);
    printf("%lld\n", res);
  }
  return 0;
}
