#include <bits/stdc++.h>
const static int NMAX = 100001;
using namespace std;
long long leftBound[NMAX];
long long rightBound[NMAX];
int value[NMAX];
bool isValue[NMAX];
int M, N;
int getElement(long long& position) {
  int left = 1, right = M, middle = 0;
  long long suspectedPosition = -1;
  do {
    left = 1, right = M, middle = 0;
    while (left <= right) {
      int middle = (left + right) / 2;
      if (leftBound[middle] <= position && position <= rightBound[middle]) {
        suspectedPosition = middle;
        break;
      } else if (leftBound[middle] > position) {
        right = middle - 1;
      } else if (leftBound[middle] < position) {
        left = middle + 1;
      }
    }
    if (!isValue[suspectedPosition])
      position = ((position - leftBound[suspectedPosition]) %
                  value[suspectedPosition]) +
                 1;
  } while (!isValue[suspectedPosition]);
  return value[suspectedPosition];
}
int main() {
  cin >> M;
  int op = 0;
  int sizeInt;
  for (int i = 1; i <= M; i++) {
    cin >> op;
    if (op == 2) {
      cin >> value[i];
      cin >> sizeInt;
      leftBound[i] = rightBound[i - 1] + 1;
      rightBound[i] = leftBound[i] + 1LL * sizeInt * value[i] - 1;
      isValue[i] = false;
    } else {
      rightBound[i] = leftBound[i] = rightBound[i - 1] + 1;
      cin >> value[i];
      isValue[i] = true;
    }
  }
  cin >> N;
  long long pos = 0;
  for (int i = 0; i < N; i++) {
    cin >> pos;
    cout << getElement(pos) << " ";
  }
  return 0;
}
