#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
struct data {
  int tip, val, ct;
};
vector<data> qu;
int valprf[100005];
long long ans[100002];
pair<long long, long long> queries[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m;
  cin >> m;
  int total = 0;
  for (int i = 1; i <= m; ++i) {
    int tip;
    cin >> tip;
    if (tip == 1) {
      int nr;
      cin >> nr;
      if (total <= 100000) valprf[++total] = nr;
      qu.push_back({1, nr});
    } else {
      int a, b;
      cin >> a >> b;
      qu.push_back({2, a, b});
      for (int x = 1; x <= b && total <= 100000; ++x)
        for (int y = 1; y <= a && total <= 100000; ++y)
          valprf[++total] = valprf[y];
    }
  }
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> queries[i].first;
    queries[i].second = i;
  }
  sort(queries + 1, queries + n + 1);
  long long poz = 0;
  long long p2 = 0;
  for (int i = 1; i <= n;) {
    int anss = 0;
    while (poz < queries[i].first) {
      if (qu[p2].tip == 1) {
        ++poz;
        if (poz == queries[i].first) {
          anss = qu[p2].val;
          ans[queries[i].second] = anss;
          ++i;
          ++p2;
          break;
        }
        ++p2;
      } else {
        if (poz + 1LL * qu[p2].ct * qu[p2].val >= queries[i].first) {
          while (i <= n &&
                 poz + 1LL * qu[p2].ct * qu[p2].val >= queries[i].first) {
            long long dif = (queries[i].first - poz) % qu[p2].val;
            if (dif == 0) dif = qu[p2].val;
            anss = valprf[dif];
            ans[queries[i].second] = anss;
            ++i;
          }
          poz += 1LL * qu[p2].ct * qu[p2].val;
        } else
          poz += 1LL * qu[p2].ct * qu[p2].val;
        ++p2;
      }
    }
    ans[queries[i].second] = anss;
  }
  for (int i = 1; i <= n; ++i) cout << ans[i] << " ";
  return 0;
}
