#coding=utf-8
from IPy import IP
write=open('result.txt','a')
allgame=open('allgame.txt')
gameline=allgame.readline()
while gameline:
name=gameline.split()[0].strip() #取名字
IP1=gameline.split()[1].strip() #取IP
ydzl=open('ydzl.txt')
ydzlread=ydzl.readline()
while ydzlread:
if (IP1) in IP(ydzlread.strip()):
result='%s %s '%(name,IP1)
write.writelines(result)
print result
break
ydzlread=ydzl.readline()
gameline=allgame.readline()