#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#define LL long long //CF223 div2 (C)----二分
#define N 100100
using namespace std;
/*
题意:给出m个操作,1表示在串中添加一个数,2表示将前面长度为l的串复制c次添加到串尾。有n个查询,问你第i个数是什么
*/
LL len[N]; //记录每次操作后整个数组的总数(也就是该数组的最后一个数)
int n, m, a[N], b[N], c[N];
LL d[N];
int binarysearch(LL x) //二分搜索它所在的数组位置
{
int l=1, r=n, mid;
while(l<=r)
{
mid=(l+r)>>1;
if(len[mid]<x)
{
l=mid+1;
}
else if(len[mid]>x)
{
r=mid-1;
}
else return mid;
}
return l;
}
int f(LL x)
{
int k;
k=binarysearch(x);
if(a[k]==1)
return b[k];
x=(x-len[k-1])%LL(b[k]); //如果是循环操作的话,则求出其的前缀相对应的序号
if(!x)x=LL(b[k]); //注意,如果是整除的话则为其前缀的最后一个数
return f(x);
}
int main()
{
int t;
while(scanf("%d", &n)!=EOF)
{
for(t=1; t<=n; ++t)
{
scanf("%d", a+t);
if(a[t]==1) //添加一个数
{
scanf("%d", b+t);
len[t]=len[t-1]+1;
}
else if(a[t]==2) //循环复制指定长度的前缀
{
scanf("%d%d", b+t, c+t);
len[t]=len[t-1]+LL(b[t])*LL(c[t]);
}
}
scanf("%d", &m);
for(t=0; t<m; ++t)
scanf("%I64d", d+t);
for(t=0; t<m; ++t)
printf("%d ", f(d[t]));
printf("\n");
}
return 0;
}