#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgogCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKSB7CiAgICBpbnQgdGFiWzEwMF07CiAKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMTAwOyArK2kpIHsKICAgICAgICBjaW4gPj4gdGFiW2ldOwogICAgfQogCiAgICBpbnQgcTsKICAgIGNpbiA+PiBxOwogCiAgICBmb3IgKGludCBpID0gMDsgaSA8IHE7ICsraSkgewogICAgICAgIGludCBrOwogICAgICAgIGNpbiA+PiBrOwogICAgICAgIGNvdXQgPDwgdGFiW2sgLSAxXSA8PCBlbmRsOwogICAgfQogCiAgICByZXR1cm4gMDsKfQog