#include <iostream>
using namespace std;
const int MAX_SIZE = 10000;
int main() {
int n, k, v[MAX_SIZE + 1], check[MAX_SIZE + 1];
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> v[i];
}
cin >> k;
for (int j = 1; j <= k; ++j) {
cin >> check[j];
for (int i = 1; i <= n; ++i) {
if (check[j] == v[i]) {
cout << check[j] << " se afla in sir \n";
check[j] = -1;
}
}
if (check[j] > -1) {
cout << check[j] << " nu se afla in sir \n";
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1BWF9TSVpFID0gMTAwMDA7CgppbnQgbWFpbigpIHsKCWludCBuLCBrLCB2W01BWF9TSVpFICsgMV0sIGNoZWNrW01BWF9TSVpFICsgMV07CgljaW4gPj4gbjsKCWZvciAoaW50IGkgPSAxOyBpIDw9IG47ICsraSkgewoJCWNpbiA+PiB2W2ldOwoJfQoJY2luID4+IGs7Cglmb3IgKGludCBqID0gMTsgaiA8PSBrOyArK2opIHsKCQljaW4gPj4gY2hlY2tbal07CgkJZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgKytpKSB7CgkJCWlmIChjaGVja1tqXSA9PSB2W2ldKSB7CgkJCQljb3V0IDw8IGNoZWNrW2pdIDw8ICIgc2UgYWZsYSBpbiBzaXIgXG4iOwoJCQkJY2hlY2tbal0gPSAtMTsKCQkJfQoJCX0KCQlpZiAoY2hlY2tbal0gPiAtMSkgewoJCQljb3V0IDw8IGNoZWNrW2pdIDw8ICIgbnUgc2UgYWZsYSBpbiBzaXIgXG4iOwoJCX0KCX0KCXJldHVybiAwOwp9