#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
struct tri {
  int op, a, b;
};
int main(void) {
  int m;
  scanf("%d", &m);
  vector<int> cur;
  vector<tri> p;
  for (int i = 0; i < (m); ++i) {
    tri t;
    scanf("%d%d", &t.op, &t.a);
    t.b = -1;
    if (t.op == 2) {
      scanf("%d", &t.b);
    }
    p.push_back(t);
  }
  long long len = 0LL;
  for (int i = 0; i < (m); ++i) {
    const tri &t = p[i];
    if (t.op == 1) {
      cur.push_back(t.a);
      ++len;
    } else {
      for (int j = 0; j < t.b && ((int)((cur).size())) < MAXN; ++j) {
        for (int k = 0; k < t.a && ((int)((cur).size())) < MAXN; ++k) {
          cur.push_back(cur[k]);
        }
      }
      len += (long long)t.a * t.b;
    }
  }
  int n;
  scanf("%d", &n);
  vector<long long> Q(n);
  for (int i = 0; i < (n); ++i) {
    scanf("%I64d", &Q[i]);
  }
  vector<int> res;
  tri last;
  int j;
  for (j = n - 1; j >= 0 && Q[j] > MAXN; --j) {
    while (len >= Q[j]) {
      if (p.back().op == 1) {
        --len;
      } else {
        len -= (long long)p.back().a * p.back().b;
      }
      last = p.back();
      p.pop_back();
    }
    if (last.op == 1) {
      res.push_back(last.a);
    } else {
      res.push_back(cur[(Q[j] - len - 1) % last.a]);
    }
  }
  while (j >= 0) {
    res.push_back(cur[Q[j] - 1]);
    --j;
  }
  reverse((res).begin(), (res).end());
  for (__typeof((res).begin()) it = (res).begin(); it != (res).end(); ++it) {
    printf("%d ", *it);
  }
  puts("");
  return 0;
}
