class LineMap:
    def __init__(self):
	self.dict = []

    def add(self,word,line):
	done = False
	for (w,ls) in self.dict:
	    if w == word:
		ls.append(line)
		done = True
	if not done:
	    self.dict.append((word,[line]))
    
    def lookup(self,word):
	for (w,ls) in self.dict:
	    if w == word:
		return ls
	return []
