numEntry = int(input())
phoneBook = {}

for i in range(numEntry):
    inputStr = input()
    pair = inputStr.split(" ")
    phoneBook.update({pair[0]:pair[1]})
    
for j in range(numEntry):
    inputStr = input()
    if inputStr in phoneBook:
        print(inputStr + "=" + phoneBook[inputStr])
    else:
        print("Not found")

8fcde70f4bfd98cde740f1c23d9b667b9c27299b
<mask token>

<mask token>
for i in range(numEntry):
    inputStr = input()
    pair = inputStr.split(' ')
    phoneBook.update({pair[0]: pair[1]})
for j in range(numEntry):
    inputStr = input()
    if inputStr in phoneBook:
        print(inputStr + '=' + phoneBook[inputStr])
    else:
        print('Not found')

numEntry = int(input())
phoneBook = {}
for i in range(numEntry):
    inputStr = input()
    pair = inputStr.split(' ')
    phoneBook.update({pair[0]: pair[1]})
for j in range(numEntry):
    inputStr = input()
    if inputStr in phoneBook:
        print(inputStr + '=' + phoneBook[inputStr])
    else:
        print('Not found')

numEntry = int(input())
phoneBook = {}

for i in range(numEntry):
    inputStr = input()
    pair = inputStr.split(" ")
    phoneBook.update({pair[0]:pair[1]})
    
for j in range(numEntry):
    inputStr = input()
    if inputStr in phoneBook:
        print(inputStr + "=" + phoneBook[inputStr])
    else:
        print("Not found")
