#include <bits/stdc++.h>
using namespace std;
int m, i, n, h, k[210000], zhan[210000], l[210000], c[210000];
long long nowl, x;
void Ad(int x, int y) {
  for (int i = 1; i <= y && zhan[0] <= 100000; i++)
    for (int j = 1; j <= x && zhan[0] <= 100000; j++) zhan[++zhan[0]] = zhan[j];
}
int main() {
  scanf("%d", &m);
  for (i = 1; i <= m; i++) {
    scanf("%d", &k[i]);
    if (k[i] == 1)
      scanf("%d", &l[i]);
    else
      scanf("%d%d", &l[i], &c[i]);
  }
  scanf("%d", &n);
  nowl = 0;
  h = 1;
  while (n--) {
    scanf("%I64d", &x);
    while (true) {
      if (k[h] == 1) {
        if (nowl + 1 < x)
          nowl++, zhan[++zhan[0]] = l[h], h++;
        else {
          printf("%d ", l[h]);
          break;
        }
      } else {
        if (nowl + l[h] * c[h] < x)
          Ad(l[h], c[h]), nowl += l[h] * c[h], h++;
        else {
          printf("%d ", zhan[(x - nowl - 1) % l[h] + 1]);
          break;
        }
      }
    }
  }
}
