#include <cstdio>
#include <iostream>
#include <map>
#include <string>
using namespace std;
map<string,string> student;
int main() {
    int n;
    while(cin>>n){
        student.clear();
        for(int i=0;i<n;i++){
            string num;
            cin>>num;
            getchar();
            string info;
            getline(cin, info);
            student[num]=info;
        }
        int m;
        cin>>m;
        for(int i=0;i<m;i++){
            string lookup;
            cin>>lookup;
            if(student[lookup]=="") cout<<"No Answer!"<<endl;
            else cout<<lookup<<" "<<student[lookup]<<endl;
        }

    }
}