#include <bits/stdc++.h>
using namespace std;
struct tuple2 {
  long long a, b;
};
struct tuple3 {
  long long a, b, c;
};
long long n, m, x;
tuple2 a[100005];
tuple3 c[100005];
bool f1(tuple2 p, tuple2 q) { return (p.a < q.a); }
bool f2(tuple2 p, tuple2 q) { return (p.b < q.b); }
bool f3(tuple3 p, tuple3 q) { return (p.a < q.a); }
long long search(long long t) {
  tuple3 u;
  tuple3* v;
  tuple2 y;
  long long w;
  u.a = t;
  u.b = 0;
  u.c = 0;
  v = upper_bound(c, c + n, u, f3);
  v--;
  if (v->c == 0) {
    y.a = v->a;
    y.b = v->b;
    w = lower_bound(a, a + x, y, f2)->a;
    return (w);
  }
  t = t - (v->a);
  t = t % (v->c);
  return (search(t));
}
int main() {
  long long i, p, q, r, l, t;
  cin >> n;
  x = 0;
  l = 0;
  for (i = 0; i < n; i++) {
    cin >> p;
    if (p == 1) {
      cin >> a[x].a;
      a[x].b = l;
      c[i].a = l;
      c[i].b = l;
      c[i].c = 0;
      l++;
      x++;
    } else {
      cin >> q >> r;
      c[i].a = l;
      c[i].b = l + q * r - 1;
      c[i].c = q;
      l = l + q * r;
    }
  }
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> t;
    cout << search(t - 1) << " ";
  }
  cout << endl;
  return 0;
}
