#include <bits/stdc++.h>
using namespace std;
long long int b[100005][3] = {0};
long long int c[100005] = {0};
vector<long long> a;
int main() {
  long int i, m;
  long long int t, p, r;
  long long int n;
  long long int s;
  cin >> m;
  a.push_back(0);
  for (i = 1; i <= m; i++) {
    scanf("%lld", &t);
    if (t == 1) {
      cin >> p;
    } else if (t == 2) {
      cin >> p >> r;
    }
    if (t == 1) {
      b[i][0] = 1;
      b[i][1] = p;
      a.push_back(a[i - 1] + 1);
    } else if (t == 2) {
      b[i][0] = 2;
      b[i][1] = p;
      b[i][2] = r;
      a.push_back(a[i - 1] + (p * r));
    }
  }
  cin >> n;
  int mid, low, high;
  int z = 0;
  for (i = 0; i < n; i++) {
    cin >> s;
    low = 1;
    high = m;
    while (1) {
      mid = high - (high - low) / 2;
      if (a[mid] == s || (a[mid] > s && a[mid - 1] < s)) {
        if (a[mid] == s && b[mid][0] == 1) {
          c[z++] = b[mid][1];
          break;
        } else {
          if (((s - a[mid - 1]) % b[mid][1]) == 0) {
            s = b[mid][1];
            low = 1;
            high = m;
          } else {
            s = (s - a[mid - 1]) % b[mid][1];
            low = 1;
            high = m;
          }
        }
      } else {
        if (a[mid] > s) {
          high = mid - 1;
        } else if (a[mid] < s) {
          low = mid + 1;
        }
      }
    }
  }
  for (i = 0; i < n; i++) cout << c[i] << endl;
  printf("\n");
  return 0;
}
