#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long m;
  vector<pair<pair<long long, long long>, pair<long long, long long>>> seg;
  seg.push_back({{0, 0}, {0, 0}});
  cin >> m;
  vector<long long> v;
  v.push_back(0);
  long long cur = 1;
  while (m--) {
    long long c;
    cin >> c;
    if (c == 1) {
      long long x;
      cin >> x;
      seg.push_back({{cur, cur}, {1, x}});
      cur++;
      v.push_back(x);
    } else {
      long long l, x;
      cin >> l >> x;
      long long orig = x;
      while (x > 0 && v.size() < 100000) {
        x--;
        for (long long i = 1; i <= l; i++) {
          v.push_back(v[i]);
        }
      }
      x = orig;
      seg.push_back({{cur, cur + (l * x) - 1}, {2, l}});
      cur = cur + l * x;
    }
  }
  long long n;
  cin >> n;
  while (n--) {
    long long a;
    cin >> a;
    long long l = 1;
    long long r = seg.size() - 1;
    pair<pair<long long, long long>, pair<long long, long long>> cur;
    while (l != r) {
      long long mid = (l + r) / 2;
      cur = seg[mid];
      if (cur.first.second < a) {
        l = mid + 1;
      } else if (cur.first.first > a) {
        r = mid - 1;
      } else {
        l = r = mid;
      }
    }
    cur = seg[l];
    if (cur.second.first == 1) {
      cout << cur.second.second << ' ';
      continue;
    } else {
      long long tmp = (a - cur.first.first) % cur.second.second;
      cout << v[tmp + 1] << ' ';
    }
  }
}
