#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> s;
long long in[N];
int L[N];
map<long long, int> mp;
int main() {
  int m, q;
  scanf("%d", &m);
  int t, l, c, x;
  for (int i = 0; i < m; i++) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d", &x);
      in[i] = 1;
      if (i) in[i] += in[i - 1];
      mp[in[i]] = x;
      if (in[i] < N) s.push_back(x);
    } else {
      scanf("%d%d", &l, &c);
      L[i] = l;
      in[i] = in[i - 1] + l * 1LL * c;
      while (c && s.size() < N) {
        bool f = 0;
        for (int j = 0; j < l; j++) {
          s.push_back(s[j]);
          if (s.size() == N) {
            f = 1;
            break;
          }
        }
        if (f) break;
        c--;
      }
    }
  }
  scanf("%d", &q);
  while (q--) {
    long long x;
    scanf("%I64d", &x);
    if (x - 1 < (int)s.size()) {
      printf("%d ", s[x - 1]);
    } else {
      if (mp.find(x) != mp.end()) {
        printf("%d ", mp[x]);
        continue;
      }
      int l = 1, r = m - 1, at = 0;
      while (l <= r) {
        int mid = (l + r) / 2;
        if (x > in[mid - 1] && x <= in[mid]) {
          at = mid;
          break;
        }
        if (x > in[mid - 1]) {
          l = mid + 1;
        } else
          r = mid - 1;
      }
      x -= in[at - 1];
      x--;
      x %= L[at];
      printf("%d ", s[x]);
    }
  }
  return 0;
}
