#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long S = 0;
  char ch = ' ';
  bool f = 0;
  while (!isdigit(ch)) {
    f |= (ch == '-');
    ch = getchar();
  }
  while (isdigit(ch)) {
    S = (S << 3) + (S << 1) + (ch - '0');
    ch = getchar();
  }
  return (f) ? (-S) : (S);
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x < 10) {
    putchar(x + '0');
    return;
  }
  write(x / 10);
  putchar(x % 10 + '0');
}
const int N = 100005;
int n, m, a[N], opt[N], wn[N], wq[N];
long long len[N];
inline int js(long long pos) {
  int l = 1, r = m, jyl = m;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (len[mid] >= pos) {
      jyl = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return jyl;
}
int main() {
  int i;
  long long pos, oo;
  m = read();
  for (i = 1; i <= m; i++) {
    opt[i] = read();
    if (opt[i] == 1) {
      a[i] = read();
      len[i] = len[i - 1] + 1;
    } else {
      wn[i] = read();
      wq[i] = read();
      len[i] = len[i - 1] + wn[i] * wq[i];
    }
  }
  n = read();
  while (n--) {
    pos = read();
    for (;;) {
      oo = js(pos);
      if (opt[oo] == 1) {
        write(a[oo]), putchar(' ');
        break;
      } else {
        oo = (pos - len[oo - 1] - 1) % wn[oo] + 1;
        pos = oo;
      }
    }
  }
  return 0;
}
