#include <bits/stdc++.h>
using namespace std;
long long LLMAX = 9223372036854775807LL;
const int MOD = 1000000007;
const int maxn = 100000 + 10;
int x[maxn], rep[maxn], type[maxn], len[maxn];
int pre[1000010];
long long dd[1000010];
int m, n;
int main() {
  scanf("%d", &(m));
  for (int(i) = 0; (i) < (int)(m); ++(i)) {
    scanf("%d", &(type[i]));
    if (type[i] == 1) {
      scanf("%d", &(x[i]));
    } else {
      scanf("%d %d", &(len[i]), &(rep[i]));
    }
  }
  dd[0] = 0;
  for (int(i) = 0; (i) < (int)(m); ++(i)) {
    if (type[i] == 1)
      dd[i + 1] = dd[i] + 1;
    else
      dd[i + 1] = dd[i] + (long long)len[i] * rep[i];
  }
  int ind = 0;
  for (int(i) = 0; (i) < (int)(m); ++(i)) {
    if (type[i] == 1) {
      pre[ind++] = x[i];
      if (ind == 1000005) break;
    } else {
      for (int(j) = 0; (j) < (int)(rep[i]); ++(j)) {
        for (int(k) = 0; (k) < (int)(len[i]); ++(k)) {
          pre[ind++] = pre[k];
          if (ind == 1000005) break;
        }
        if (ind == 1000005) break;
      }
    }
    if (ind == 1000005) break;
  }
  int cur = 0;
  scanf("%d", &(n));
  for (int(i) = 0; (i) < (int)(n); ++(i)) {
    long long pp;
    cin >> pp;
    pp--;
    while (pp >= dd[cur + 1]) cur++;
    if (type[cur] == 1)
      printf("%d", x[cur]);
    else
      printf("%d", pre[(pp - dd[cur]) % len[cur]]);
    printf("%c", (i == n - 1) ? '\n' : ' ');
  }
}
