#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int m, n;
  cin >> m;
  pair<int, long long> stages[m];
  for (int i = 0; i < (m); i++) {
    int p, q, r;
    cin >> p;
    if (p == 1) {
      cin >> q;
      stages[i] = make_pair(p, q);
    } else {
      cin >> q >> r;
      stages[i] = make_pair(p, 10001 * q + r);
    }
  }
  cin >> n;
  long long a[n];
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
  }
  int nums[100000];
  int i = 0, j = 0;
  long long len = 0, t;
  while (len < 100000) {
    if (stages[i].first == 1) {
      nums[len] = stages[i].second;
      len++;
    } else {
      int l = stages[i].second / 10001, c = stages[i].second % 10001;
      bool fl = false;
      if (len + l * c >= 100000) {
        t = len;
      }
      if (len + l * c > 100000) fl = true;
      for (int q = 0; q < (c); q++) {
        for (int p = 0; p < (l); p++) {
          nums[len] = nums[p];
          len++;
          if (len == 100000) break;
        }
        if (len == 100000) break;
      }
      if (len == 100000) {
        len = t;
        break;
      }
    }
    i++;
    if (i == m) break;
  }
  while (j != n) {
    if (a[j] <= 100000) {
      cout << nums[a[j] - 1] << " ";
      j++;
    } else if (a[j] <= len) {
      int l = stages[i].second / 10001, c = stages[i].second % 10001;
      long long t = len - l * c;
      long long index = (a[j] - t - 1) % l;
      cout << nums[index] << " ";
      j++;
    } else {
      if (stages[i].first == 1 && a[j] == len + 1) {
        cout << stages[i].second << " ";
        len++;
        j++;
        i++;
      } else if (stages[i].first == 1) {
        len++;
        i++;
      } else {
        int l = stages[i].second / 10001, c = stages[i].second % 10001;
        long long z = len + l * c;
        if (z < a[j]) {
          len += l * c;
          i++;
        } else {
          long long index = (a[j] - len - 1) % l;
          cout << nums[index] << " ";
          j++;
        }
      }
    }
  }
}
