#include <iostream>
#include <vector>
#include <string>
using namespace std;

typedef struct {
    string num;
    string name;
    string gender;
    int age;
} Student;

int main() {
    int n;
    cin >> n;
    vector<Student> stu(n);
    for (int i = 0; i < n; i++) {
        cin >> stu[i].num >> stu[i].name >> stu[i].gender >> stu[i].age;
    }
    int m;
    cin >> m;
    bool flag;
    for (int i = 0; i < m; i++) {
        flag = false;
        string temp;
        cin >> temp;
        for (int i = 0; i < n; i++) {
            if (temp == stu[i].num) {
                cout << stu[i].num << " " << stu[i].name << " " << stu[i].gender << " " <<
                     stu[i].age << endl;
                flag = true;
            }
        }
        if (!flag) {
            cout << "No Answer!" << endl;
        }
    }
}
// 64 位输出请用 printf("%lld")