#include <iostream>
#include <cstdio>
#include <map>
#include <string>
using namespace std;
map<string, string> student;
int main(int argc, char** argv) {
int n;
scanf("%d", &n);
getchar();
for(int i = 0; i < n; i++){
string str;
getline(cin, str);
int pos = str.find(" ");
string key = str.substr(0, pos);
student[key] = str;
}
int m;
scanf("%d", &m);
for(int i = 0; i < m; i++){
string key;
cin >> key;
string answer = student[key];
if(answer == " "){
answer = "No answer!";
}
cout << answer << endl;
}
return 0;
}