#include <bits/stdc++.h>
int m, n, a[100010], b[100010], c[100010], e[100010];
long long d[100010];
int main() {
  int i, j, k;
  long long len;
  scanf("%d", &m);
  for (i = 1; i <= m; ++i) {
    scanf("%d", &a[i]);
    if (a[i] == 1)
      scanf("%d", &b[i]);
    else
      scanf("%d %d", &b[i], &c[i]);
  }
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%I64d", &d[i]);
  j = 1;
  len = 0;
  for (i = 1; i <= m; ++i) {
    if (a[i] == 1) {
      ++len;
      if (len <= 100000) e[len] = b[i];
      while (j <= n && d[j] == len) {
        ++j;
        printf("%d ", b[i]);
      }
    } else {
      if (len < 100000) {
        for (k = len + 1; k <= 100000 && k <= len + b[i] * c[i]; ++k)
          e[k] = e[(k - len) % b[i] == 0 ? b[i] : (k - len) % b[i]];
      }
      while (j <= n && d[j] <= len + b[i] * c[i]) {
        printf("%d ", e[(d[j] - len) % b[i] == 0 ? b[i] : (d[j] - len) % b[i]]);
        ++j;
      }
      len += b[i] * c[i];
    }
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
