#include <iostream>
using namespace std;
int main() {
int tab[100];
for(int i=0;i<100;i++) {
cin >> tab[i];
}
int q;
cin >> q;
for (int i = 0; i < q; i++) {
int k;
cin >> k;
cout << tab[k - 1] << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCWludCB0YWJbMTAwXTsKCQoJZm9yKGludCBpPTA7aTwxMDA7aSsrKSB7CgkJY2luID4+IHRhYltpXTsKCX0KCQoJaW50IHE7CgljaW4gPj4gcTsKCQoJZm9yIChpbnQgaSA9IDA7IGkgPCBxOyBpKyspIHsKICAgICAgICBpbnQgazsKICAgICAgICBjaW4gPj4gazsKICAgICAgICBjb3V0IDw8IHRhYltrIC0gMV0gPDwgZW5kbDsKICAgIH0KCglyZXR1cm4gMDsKfQ==