#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
long long n, m, a[211111], cnt[211111], ty[211111], x[211111], l[211111],
    t[211111], b[211111];
int main() {
  long long i, j, k, y, z, ca = 1, re = 0, tot = 1;
  scanf("%I64d", &(n));
  for (int i = (int)(1); i <= (int)(n); ++i) {
    scanf("%I64d", &(ty[i]));
    if (ty[i] == 1) {
      scanf("%I64d", &(x[i]));
      if (tot <= 200000) a[tot++] = x[i];
      cnt[i] = cnt[i - 1] + 1;
    } else {
      scanf("%I64d%I64d", &(l[i]), &(t[i]));
      long long st = tot;
      for (tot; tot <= min(200000ll, st + l[i] * t[i] - 1); tot++) {
        int rr = (tot - st) % l[i] + 1;
        a[tot] = a[rr];
      }
      cnt[i] = cnt[i - 1] + l[i] * t[i];
    }
  }
  scanf("%I64d", &(m));
  for (i = 0; i < m; ++i) scanf("%I64d", &(b[i]));
  for (int i = 0; i < (int)(m); ++i) {
    y = upper_bound(cnt + 1, cnt + n + 1, b[i]) - cnt;
    if (cnt[y - 1] == b[i]) {
      if (ty[y - 1] == 1)
        cout << x[y - 1] << ' ';
      else
        cout << a[l[y - 1]] << ' ';
    } else {
      int rr = b[i] - cnt[y - 1];
      rr %= l[y];
      if (rr == 0) rr += l[y];
      cout << a[rr] << ' ';
    }
  }
  return 0;
}
