#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
using namespace std;
struct Student{ //学生的结构体
char id[100]; //统一用数组来接收
char name[50];
char sex[10];
int age;
};
Student stu[1000]; //学生数组
int main() {
int N;//学生的个数
scanf("%d", &N);
//输入学生信息
for(int i = 0; i < N; i++){ //输入输出一定要记得用C风格的
scanf("%s %s %s %d", &stu[i].id, &stu[i].name, &stu[i].sex, &stu[i].age);
}
int M; //有多少个要查询的学生
scanf("%d", &M);
char c[10000];
for(int i = 0; i < M; i++){
scanf("%s", c); //c为学号
int j = 0;
for(; j < N; j++){
//要把两个学号统一换成字符串,只有这样才能用==来比较
string str1 = c;
string str2 = stu[j].id;
if(str1 == str2){
printf("%s %s %s %d\n", stu[j].id, stu[j].name, stu[j].sex, stu[j].age);
break;
}
}
if(j == N){
printf("No Answer!\n");
}
}
}
// 64 位输出请用 printf("%lld")