# Enter your code here. Read input from STDIN. Print output to STDOUT
NumPhones = int(input())
PhoneDict = {}
# Cria o Dicionário
for n in range(NumPhones):
    PhoneList = list(map(str, input().split()))
    PhoneDict.update({PhoneList[0]: PhoneList[1]})

# Printa nome=numero, caso esteja no dict, se nao printa not found.
while True:
    try:
        Nome = str(input())
        if Nome in PhoneDict:
            print(Nome + "=" + PhoneDict[Nome])
        else:
            print("Not found")
    except:
        break

6ca44e6887932bbfbe84222200c33a6bf264e801
<mask token>

<mask token>
for n in range(NumPhones):
    PhoneList = list(map(str, input().split()))
    PhoneDict.update({PhoneList[0]: PhoneList[1]})
while True:
    try:
        Nome = str(input())
        if Nome in PhoneDict:
            print(Nome + '=' + PhoneDict[Nome])
        else:
            print('Not found')
    except:
        break

NumPhones = int(input())
PhoneDict = {}
for n in range(NumPhones):
    PhoneList = list(map(str, input().split()))
    PhoneDict.update({PhoneList[0]: PhoneList[1]})
while True:
    try:
        Nome = str(input())
        if Nome in PhoneDict:
            print(Nome + '=' + PhoneDict[Nome])
        else:
            print('Not found')
    except:
        break

# Enter your code here. Read input from STDIN. Print output to STDOUT
NumPhones = int(input())
PhoneDict = {}
# Cria o Dicionário
for n in range(NumPhones):
    PhoneList = list(map(str, input().split()))
    PhoneDict.update({PhoneList[0]: PhoneList[1]})

# Printa nome=numero, caso esteja no dict, se nao printa not found.
while True:
    try:
        Nome = str(input())
        if Nome in PhoneDict:
            print(Nome + "=" + PhoneDict[Nome])
        else:
            print("Not found")
    except:
        break
