while True:
    try:
        ide = []
        name = []
        sex = []
        age = []
        flag = 0
    
        n = int(input())
        for i in range(n):
            a, b, c, d = input().split()   
            ide.append(a)
            name.append(b)
            sex.append(c)
            age.append(d)
        m = int(input())
        
        for k in range(m):
            flag = 0
            find = input()
            for i in range(n):
                if ide[i] == find:
                    flag = 1
                    print("%s %s %s %s"%(ide[i], name[i], sex[i], age[i]))
            if flag == 0:
                print("No Answer!")
    except:
        break