#include <bits/stdc++.h>
using namespace std;
const int MAX_M = 100000;
struct Elm {
  long long i0, i1;
  int x, l, c;
  Elm() {}
  Elm(long long _i0, long long _i1) : i0(_i0), i1(_i1), x(), l(), c() {}
  Elm(long long _i0, long long _i1, int _x)
      : i0(_i0), i1(_i1), x(_x), l(), c() {}
  Elm(long long _i0, long long _i1, int _l, int _c)
      : i0(_i0), i1(_i1), x(), l(_l), c(_c) {}
  bool operator<(const Elm &e) const {
    return i1 < e.i1 || (i1 == e.i1 && i0 < e.i0);
  }
};
Elm es[MAX_M];
int main() {
  int m;
  scanf("%d", &m);
  long long p = 0;
  for (int i = 0; i < m; i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int x;
      scanf("%d", &x);
      es[i] = Elm(p, p + 1, x);
      p++;
    } else {
      int l, c;
      scanf("%d%d", &l, &c);
      long long p1 = p + l * c;
      es[i] = Elm(p, p1, l, c);
      p = p1;
    }
  }
  int n;
  scanf("%d", &n);
  for (int cont = 0; n--;) {
    long long k;
    scanf("%lld", &k);
    k--;
    for (;;) {
      int i = lower_bound(es, es + m, Elm(k, k)) - es;
      if (es[i].x > 0) {
        if (cont) putchar(' ');
        printf("%d", es[i].x);
        cont = true;
        break;
      }
      k = (k - es[i].i0) % es[i].l;
    }
  }
  putchar('\n');
  return 0;
}
