#include <bits/stdc++.h>
using namespace std;
const bool D = 0;
struct Query {
  int p, t, x;
  friend istream &operator>>(istream &stream, Query &query) {
    stream >> query.p >> query.t;
    if (query.t == 1) {
      stream >> query.x;
    } else {
      query.t = -1;
    }
    --query.p;
    return stream;
  }
  friend ostream &operator<<(ostream &stream, Query &query) {
    stream << query.p << " " << query.t;
    if (query.t == 1) {
      stream << " " << query.x;
    }
    return stream;
  }
};
struct SegmentTree {
  vector<int> tree, pushing;
  void build(int n) {
    tree.clear();
    pushing.clear();
    tree.resize(4 * n, 0);
    pushing.resize(4 * n, 0);
  }
  void push(int v, int l, int r) {
    if (l < r) {
      tree[v * 2] += pushing[v];
      tree[v * 2 + 1] += pushing[v];
      pushing[v * 2] += pushing[v];
      pushing[v * 2 + 1] += pushing[v];
    }
    pushing[v] = 0;
  }
  void update(int v, int tl, int tr, int l, int r, int x) {
    push(v, tl, tr);
    if (l > r) {
      return;
    }
    if (tl == l && tr == r) {
      tree[v] += x;
      pushing[v] += x;
      return;
    }
    int tm = (tl + tr) / 2;
    update(v * 2, tl, tm, l, min(tm, r), x);
    update(v * 2 + 1, tm + 1, tr, max(tm + 1, l), r, x);
    tree[v] = max(tree[v * 2], tree[v * 2 + 1]);
  }
  int get(int v, int tl, int tr, int l, int r, int k) {
    push(v, tl, tr);
    if (l > r) {
      return -1;
    }
    if (tree[v] < k) {
      return -1;
    }
    if (tl == tr) {
      return tl;
    }
    int tm = (tl + tr) / 2;
    if (tree[v * 2 + 1] >= k) {
      return get(v * 2 + 1, tm + 1, tr, max(tm + 1, l), r, k);
    }
    return get(v * 2, tl, tm, l, min(tm, r), k);
  }
};
int n, position;
vector<int> values;
vector<Query> queries;
SegmentTree tr;
int main() {
  cin >> n;
  queries.resize(n);
  values.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> queries[i];
    if (D) {
      cout << queries[i] << endl;
    }
    if (queries[i].t == 1) {
      values[queries[i].p] = queries[i].x;
    }
  }
  tr.build(n);
  for (int i = 0; i < n; ++i) {
    tr.update(1, 0, n - 1, 0, queries[i].p, queries[i].t);
    position = tr.get(1, 0, n - 1, 0, n - 1, 1);
    if (position == -1) {
      cout << position << endl;
    } else {
      cout << values[position] << endl;
    }
  }
  return 0;
}
