#include <bits/stdc++.h>
using namespace std;
int m, n;
int L[1000000];
int C[1000000];
int T[1000000];
int X[1000000];
long long S[1000000];
int getPosition(long long k) {
  int a = 0;
  int b = m;
  while (b - a > 1) {
    int mid = (a + b) / 2;
    if (S[mid] <= k) {
      a = mid;
    } else {
      b = mid;
    }
  }
  return b;
}
int query(long long k) {
  int pos = getPosition(k);
  if (T[pos] == 1) {
    return X[pos];
  }
  while (T[pos] != 1) {
    k = (k - S[pos - 1]) % L[pos];
    pos = getPosition(k);
  }
  return X[pos];
}
int main(int argc, char *argv[]) {
  scanf("%d", &m);
  S[0] = 0;
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &T[i]);
    if (T[i] == 1) {
      scanf("%d", &X[i]);
      S[i] = 1LL + S[i - 1];
    } else {
      scanf("%d%d", &L[i], &C[i]);
      S[i] = S[i - 1] + (long long)(L[i]) * (long long)(C[i]);
    }
  }
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    long long k;
    cin >> k;
    int sol = query(k - 1LL);
    printf("%d ", sol);
  }
  printf("\n");
  return 0;
}
