#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int inf = 1023456789;
template <typename T>
inline void chkmax(T &a, T b) {
  if (a < b) a = b;
}
template <typename T>
inline void chkmin(T &a, T b) {
  if (a > b) a = b;
}
template <typename T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline T expmod(T a, T b, T c = mod) {
  T rlt = 1;
  for (a %= c; b; b >>= 1, a = a * a % c)
    if (b & 1) rlt = rlt * a % c;
  return rlt;
}
int m, type[100100], x[100100], l[100100], c[100100];
int sz, a[100100], q, ans[100100];
long long n, id[100100];
int main() {
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &type[i]);
    if (type[i] == 1)
      scanf("%d", &x[i]);
    else
      scanf("%d %d", &l[i], &c[i]);
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) scanf("%I64d", &id[i]);
  int i = 1, j = 1;
  while (j <= q) {
    assert(n < id[j]);
    while (1) {
      if (type[i] == 1) {
        if (n < 100000) a[++sz] = x[i];
        n++;
        if (id[j] == n) {
          ans[j++] = x[i++];
          break;
        }
        i++;
      } else {
        int cur = 1, step = l[i] * c[i];
        while (sz < 100000 && step) {
          step--;
          cur = (cur - 1) % l[i] + 1;
          a[++sz] = a[cur++];
        }
        long long nn = n + l[i] * c[i];
        if (nn < id[j]) {
          n = nn;
          i++;
          continue;
        }
        while (j <= q && id[j] <= nn) {
          int cur = (id[j] - n - 1) % l[i] + 1;
          ans[j++] = a[cur];
        }
        n = nn, i++;
        break;
      }
    }
  }
  for (int i = 1; i <= q; i++) printf("%d%c", ans[i], i < q ? ' ' : '\n');
  return 0;
}
