#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return (a % b == 0 ? b : GCD(b, a % b));
}
long long POW(long long base, long long exp) {
  long long val;
  val = 1;
  while (exp > 0) {
    if (exp % 2 == 1) {
      val = (val * base) % 1000000007;
    }
    base = (base * base) % 1000000007;
    exp = exp / 2;
  }
  return val;
}
struct block {
  int type;
  int x;
  int l, c;
};
vector<int> a;
long long q[100005];
int main() {
  int n, m, i, j, it, jt;
  long long cur, diff;
  scanf("%d", &n);
  vector<block> v(n);
  for (i = 0; i < n; i++) {
    scanf("%d", &v[i].type);
    if (v[i].type == 1) {
      scanf("%d", &v[i].x);
    } else {
      scanf("%d%d", &v[i].l, &v[i].c);
    }
  }
  scanf("%d", &m);
  for (i = 0; i < m; i++) {
    cin >> q[i];
  }
  cur = 0;
  i = 0;
  j = 0;
  while (cur < q[m - 1]) {
    if (a.size() < 100000) {
      if (v[i].type == 1) {
        a.push_back(v[i].x);
      } else {
        for (it = 0; it < v[i].c; it++) {
          for (jt = 0; jt < v[i].l; jt++) {
            a.push_back(a[jt]);
            if (a.size() >= 100000) break;
          }
          if (a.size() >= 100000) break;
        }
      }
    }
    if (v[i].type == 1) {
      while (j < m && q[j] <= cur + 1) {
        printf("%d ", v[i].x);
        j++;
      }
      cur = cur + 1;
    } else {
      while (j < m && q[j] <= cur + v[i].c * 1LL * v[i].l) {
        diff = q[j] - cur - 1;
        diff = diff % v[i].l;
        printf("%d ", a[diff]);
        j++;
      }
      cur = cur + v[i].c * 1LL * v[i].l;
    }
    i++;
  }
  return 0;
}
