def _WordPrefixes(words):
    """Returns a set with all the strings that can become longer words."""
    word_prefixes =  set()
    for word in words:
        for i in range(len(word)-1):
          word_prefixes.add(word[:i+1])
    return word_prefixes