#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
string str(const string& s) { return s; }
string str(int x) {
  ostringstream ss;
  ss << x;
  return ss.str();
}
template <typename T>
string str(T v) {
  ostringstream ss;
  ss << "[";
  for (typeof((v).begin()) x = (v).begin(); x != (v).end(); ++x)
    ss << str(*x) << ",";
  ss << "]";
  return ss.str();
}
struct Interv {
  int character;
  long long left, right, prefixLen, repeat;
  Interv(int c, long long l, long long r, long long pl = -1,
         long long rp = -1) {
    character = c;
    left = l;
    right = r;
    prefixLen = pl;
    repeat = rp;
  }
  long long convert(long long pos) { return (pos - left) % prefixLen; }
  bool contains(long long pos) { return left <= pos && pos <= right; }
};
vector<Interv> intervs;
int binary_search(long long pos) {
  int lo = 0, hi = intervs.size() - 1;
  while (lo < hi) {
    int mid = lo + (hi - lo) / 2;
    if (intervs[mid].contains(pos))
      return mid;
    else if (pos > intervs[mid].right)
      lo = mid + 1;
    else if (pos < intervs[mid].left)
      hi = mid;
  }
  assert(intervs[lo].contains(pos));
  return lo;
}
int main() {
  ios_base::sync_with_stdio(false);
  int steps;
  cin >> steps;
  for (int i = 0; i < (int)steps; i++) {
    long long start = intervs.empty() ? 0 : intervs.rbegin()->right + 1;
    int type;
    long long param1, param2;
    cin >> type >> param1;
    if (type == 1)
      intervs.push_back(Interv(param1, start, start));
    else {
      cin >> param2;
      intervs.push_back(
          Interv(0, start, start + param1 * param2 - 1, param1, param2));
    }
  }
  int nq;
  cin >> nq;
  for (int i = 0; i < (int)nq; i++) {
    long long pos;
    cin >> pos;
    pos--;
    while (true) {
      int idx = binary_search(pos);
      if (intervs[idx].character) {
        cout << intervs[idx].character << " ";
        break;
      } else
        pos = intervs[idx].convert(pos);
    }
  }
  cout << endl;
}
