#include <bits/stdc++.h>
using namespace std;
struct L {
  int type;
  int a;
  int b;
  long long nowlen;
} s[300000];
int sp;
long long nowlen;
void query(long long num) {
  int l = 0;
  int r = sp;
  while (l < r) {
    int mid = (l + r) / 2;
    if (s[mid].nowlen < num)
      l = mid + 1;
    else
      r = mid;
  }
  int sid = l;
  if (s[sid].type == 1)
    printf("%d ", s[sid].a);
  else {
    long long prenum = (num - s[sid - 1].nowlen) % s[sid].a;
    if (prenum == 0) prenum = s[sid].a;
    query(prenum);
  }
}
int main() {
  int m;
  scanf("%d", &m);
  sp = 0;
  nowlen = 0;
  while (m--) {
    scanf("%d", &s[sp].type);
    if (s[sp].type == 1) {
      scanf("%d", &s[sp].a);
      nowlen++;
      s[sp].nowlen = nowlen;
      sp++;
    } else {
      scanf("%d%d", &s[sp].a, &s[sp].b);
      nowlen += ((long long)s[sp].a) * s[sp].b;
      s[sp].nowlen = nowlen;
      sp++;
    }
  }
  int n;
  scanf("%d", &n);
  while (n--) {
    long long querynum;
    cin >> querynum;
    query(querynum);
  }
  return 0;
}
