#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
int a[N], id[N], x[N], y[N], ans[N];
long long b[N];
int main() {
  int n, m, cnt = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &id[i]);
    if (id[i] == 1)
      scanf("%d", &x[i]);
    else
      scanf("%d%d", &x[i], &y[i]);
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) scanf("%I64d", &b[i]), b[i]--;
  long long now = 0, nxt;
  int l = 0;
  for (int i = 0; i < n; i++) {
    if (id[i] == 1) {
      nxt = now + 1;
      if (now < N) a[now] = x[i];
      if (b[l] == now && l < m) {
        ans[cnt++] = x[i];
        l++;
      }
      now = nxt;
    } else {
      nxt = now + 1ll * x[i] * y[i];
      while (b[l] < nxt && l < m) {
        int t = a[(b[l] - now) % x[i]];
        ans[cnt++] = t;
        l++;
      }
      if (now < N) {
        for (int j = now; j < min(N, (int)nxt); j++) {
          a[j] = a[(j - (int)now) % x[i]];
        }
      }
      now = nxt;
    }
  }
  for (int i = 0; i < cnt; i++) printf("%d ", ans[i]);
  return 0;
}
