#include <iostream>
#include <map>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int N, M;
    while(cin >> N){
        map<string, string> m;
        string ID, name, gender, age;
        for(int i = 0; i < N; i++){
            string ID, name, gender, age;
            cin >> ID >> name >> gender >> age;
            string s = ID + " " + name + " " + gender + " " + age;
            m[ID] = s;
        }
        cin >> M;
        for(int i = 0; i < M; i++){
            string x;
            cin >> x;
            if(m.count(x)) cout << m[x] << "\n";
            else cout << "No Answer!" << "\n";
        }
    }
    return 0;
}