#include <iostream>
using namespace std;
class person{
    public:
    string no;
    string name;
    string sex;
    int age;
    public:
    void say(){
        cout<<no<<" "<<name<<" "<<sex<<" "<<age<<endl;
    }
};
int main() {
    int n;cin>>n;
    person arr[n];
    person p;string no,name,sex;int age;
    for(int i =0;i<n;i++){
        cin>>no>>name>>sex>>age;
        p.no = no;
        p.name = name;
        p.sex = sex;
        p.age = age;
        arr[i] = p;
    }
    //开始查找
    int m;cin>>m;
    while(m--){
        bool isFind = false;
        string tempNo;cin>>tempNo;
        for(auto a:arr){
            if(a.no == tempNo){
                a.say();
                isFind=1;
                break;
            }
        }
        if(!isFind)
            cout<<"No Answer!"<<endl;
    }
}
// 64 位输出请用 printf("%lld")