#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const long long mod = 1e9 + 7;
const long long inf = 0x3f3f3f3f;
long long n, m, l, tot, seg, ans[N];
struct Segment {
  long long c, t, val, lt;
} a[N];
namespace FastIO {
template <typename tp>
inline void read(tp &x) {
  x = 0;
  register char c = getchar();
  register bool f = 0;
  for (; c < '0' || c > '9'; f |= (c == '-'), c = getchar())
    ;
  for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar())
    ;
  if (f) x = -x;
}
template <typename tp>
inline void write(tp x) {
  if (x == 0) return (void)(putchar('0'));
  if (x < 0) putchar('-'), x = -x;
  long long pr[20];
  register long long cnt = 0;
  for (; x; x /= 10) pr[++cnt] = x % 10;
  while (cnt) putchar(pr[cnt--] + '0');
}
template <typename tp>
inline void writeln(tp x) {
  write(x);
  putchar('\n');
}
}  // namespace FastIO
using namespace FastIO;
long long Solve(long long x) {
  while (a[l + 1].lt < x) l++;
  if (a[l].t == 1)
    return a[l].val;
  else
    return ans[(x - a[l].lt - 1) % a[l].val + 1];
}
signed main() {
  read(n);
  for (long long i = 1; i <= n; i++) {
    read(a[i].t);
    a[i].lt = tot;
    if (a[i].t == 1) {
      read(a[i].val), ++tot;
      if (tot <= 1e5) ans[tot] = a[i].val;
    } else {
      read(a[i].val), read(a[i].c);
      for (long long j = tot + 1;
           j <= min((long long)100000, tot + a[i].val * a[i].c); j++) {
        ans[j] = ans[(j - tot - 1) % a[i].val + 1];
      }
    }
    tot += a[i].val * a[i].c;
  }
  a[n + 1].lt = inf * inf;
  l = 1;
  read(m);
  for (long long i = 1; i <= m; i++) {
    long long x;
    read(x);
    write(Solve(x));
    putchar(' ');
  }
  return 0;
}
