//土尔逊Torson 编写于2023/06/13
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#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;
}
system("pause");
return EXIT_SUCCESS;
}
// 64 位输出请用 printf("%lld")