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

struct node {
    string id;
    string name;
    string sex;
    int age;
};

int main() {
    int n;
    cin >> n;
    vector<node> s(n);

    for (int i = 0 ; i < n ; i++) {
        cin >> s[i].id >> s[i].name >> s[i].sex >> s[i].age;
    }


    int m;
    cin >> m;
    while(m--) {
        string t ;
        bool isfind = false;
        cin >> t;
        for (int i = 0 ; i < n ; i++) {
            if (s[i].id == t) {
                cout << s[i].id << " " << s[i].name << " " << s[i].sex << " " <<  s[i].age << endl;
                isfind = true;
            }
        }
        if(!isfind) cout << "No Answer!" << endl;
    }
}