#include<iostream>
#include<string>
#include<cstring>
#include<map>
using namespace std;
/*
查找学生信息
*/
int main()
{
int n;
cin>>n;
getchar();//为什么要吃掉回车?
map<string,string> ma;
string student;
string id;
for(int i=0;i<n;i++)
{
getline(cin,student);
int position= student.find(" ");//
id=student.substr(0,position);
ma.insert(pair<string,string>(id,student));
}
int m;
cin>>m;
for(int i=0;i<m;i++)
{
cin>>id;
if(ma.find(id)!=ma.end())
{
cout<<ma[id]<<endl;
}
else{
cout<<"No Answer!"<<endl;
}
}
return 0;
}