#include <bits/stdc++.h>
using namespace std;
long long num[100005], s;
struct Segment {
  long long l, r;
  long long ls, rs;
} segments[100005];
long long bfind(long long low, long long high, long long a) {
  long long mid;
  while (low <= high) {
    mid = (low + high) / 2;
    if (segments[mid].l <= a && a <= segments[mid].r) return mid;
    if (segments[mid].l > a)
      high = mid - 1;
    else
      low = mid + 1;
  }
  return -1;
}
int main() {
  long long n, m;
  long long q, a, b, slength;
  while (cin >> m) {
    s = slength = 0;
    for (long long i = 0; i < m; i++) {
      cin >> q;
      if (q == 1) {
        cin >> a;
        num[s] = a;
        segments[i].l = segments[i].r = slength;
        segments[i].ls = segments[i].rs = s;
        s++, slength++;
      } else {
        cin >> a >> b;
        segments[i].l = slength;
        segments[i].r = slength + a * b - 1;
        segments[i].ls = 0, segments[i].rs = a - 1;
        slength += a * b;
      }
    }
    cin >> n;
    while (n--) {
      cin >> a;
      a--;
      long long mid;
      mid = -1;
      long long tt = m - 1;
      while (1) {
        mid = bfind(0, tt, a);
        if (segments[mid].l == segments[mid].r) break;
        long long tmp1 = segments[mid].rs - segments[mid].ls + 1;
        long long tmp2 = a - segments[mid].l;
        a = tmp2 % tmp1;
        tt = mid;
      }
      cout << num[segments[mid].rs] << " ";
    }
    puts("");
  }
  return 0;
}
