//P174 映射的应用 [散列表map]
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
map<string,string> student;
int main(){
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;
map<string,string>::iterator it = student.find(key); //方法二 使用迭代器
if(it != student.end()){
cout<< it->second<<endl;
}else{
cout<<"No Answer!"<<endl;
}
}
return 0;
}