#include <bits/stdc++.h>
using namespace std;
long long yl[100005][3];
long long num[100005], m, n;
long long bs(long long x) {
  int l = 1, r = m, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (num[mid] >= x && num[mid - 1] < x)
      return mid;
    else if (num[mid] < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return mid;
}
long long findans(long long x) {
  long long p = bs(x);
  if (yl[p][0] == 1) return yl[p][1];
  long long w = p;
  p = x - num[p - 1];
  p = (p + yl[w][1]) % yl[w][1];
  if (p == 0) p = yl[w][1];
  return findans(p);
}
int main() {
  while (cin >> m) {
    for (int i = 1; i <= m; i++) {
      cin >> yl[i][0];
      if (yl[i][0] == 1) {
        cin >> yl[i][1];
        if (i != 1)
          num[i] = num[i - 1] + 1;
        else
          num[i] = 1;
      } else {
        cin >> yl[i][1] >> yl[i][2];
        num[i] = num[i - 1] + yl[i][1] * yl[i][2];
      }
    }
    cin >> n;
    long long x;
    while (n--) {
      cin >> x;
      cout << findans(x) << " ";
    }
    cout << endl;
  }
  return 0;
}
