#include <bits/stdc++.h>
using namespace std;
long long int scanInt() {
  long long int num = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    num = num * 10 + (c - 48);
    c = getchar();
  }
  return num;
}
struct Node {
  long long int index;
  long long int l;
  long long int c;
};
Node arr[1000000];
unordered_map<long long int, long long int> vals;
int binarySearch(long long int a, long long int b) {
  long long int start = 0, end = b - 1, mid;
  while (start <= end) {
    mid = (start + end) / 2;
    if (arr[mid].index >= a) {
      if (mid == 0)
        break;
      else if (arr[mid - 1].index < a)
        break;
      else if (arr[mid - 1].index >= a)
        end = mid - 1;
    } else if (arr[mid].index < a)
      start = mid + 1;
  }
  long long int temp = (a - arr[mid - 1].index) % arr[mid].l;
  if (!temp) temp = arr[mid].l;
  if (vals.find(temp) != vals.end())
    return vals[temp];
  else
    return binarySearch(temp, b);
}
int main() {
  long long int i, n, m = 0;
  n = scanInt();
  for (i = 0; i < n; i++) {
    long long int a, b, c;
    a = scanInt();
    if (a == 1) {
      b = scanInt();
      vals.insert({m + 1, b});
      arr[i].index = m + 1;
      arr[i].l = 1;
      arr[i].c = 0;
      m = arr[i].index;
    } else {
      b = scanInt();
      c = scanInt();
      arr[i].index = arr[i - 1].index + b * c;
      arr[i].l = b;
      arr[i].c = c;
      m = arr[i].index;
    }
  }
  m = scanInt();
  while (m--) {
    i = scanInt();
    if (vals.find(i) != vals.end()) {
      cout << vals[i] << " ";
    } else {
      cout << binarySearch(i, n) << " ";
    }
  }
  return 0;
}
