#include <iostream>

using namespace std;

struct student{
	int num;
	string name;
	string sex;
	int age;
}stu[1100];

int main(){
	int n,m;
	cin >> n;
	for(int i = 0;i < n;i ++)cin >> stu[i].num >> stu[i].name >> stu[i].sex >> stu[i].age;
	
	cin >> m;
	while(m --){
		int num;
		cin >> num;
		bool flag = false;
		for(int i = 0;i < n;i ++){
			if(stu[i].num == num){
				cout << stu[i].num << " " << stu[i].name << " " << stu[i].sex << " " << stu[i].age << endl;
				flag = true;
				break;
			}
		}
		if(!flag)cout << "No Answer!" << endl;
	}
	
	return 0;
}