#include<cstdio>
#include<string>
#include<map>
using namespace std;
struct Student{
string name;
string gender;
int age;
};
int main(){
int n;
scanf("%d",&n);
map<string,Student> infoMap;
for(int i = 0; i < n; ++i){
char num[30];
char name[30];
char gender[30];
int age;
scanf("%s%s%s%d",num,name,gender,&age);
//把字符串信息转化为想要的信息(C++风格字符串类型)
string numstr = num;//C->C++
Student student;
student.name = name;
student.gender = gender;
student.age = age;
infoMap[numstr] = student;
}
int m;
scanf("%d",&m);
for(int i = 0; i < m; ++i){
char num[30];
scanf("%s",num);
string numstr = num;//C-->C++
if(infoMap.find(numstr) != infoMap.end()){
//找到键值对
printf("%s %s %s %d\n",numstr.c_str(),
infoMap[numstr].name.c_str(),
infoMap[numstr].gender.c_str(),
infoMap[numstr].age);
}
else{
printf("No Answer!\n");
}
}
system("pause");
}