Problem ID: 628

Although this is not clearly mentioned in the problem statement, the following is probably true:

If there exists one word in the dictionary there can exist several #'s in the input; otherwise, if there exist several words in the dictionary, there exists no more than one # in the judge's input.

The input on uDebug attempts to follow this rule.