from typing import List


def mutate_sentences(sentence: str) -> List[str]:
    """
    Given a sentence (sequence of words), return a list of all "similar"
    sentences.
    We define a sentence to be similar to the original sentence if
      - it as the same number of words, and
      - each pair of adjacent words in the new sentence also occurs in the original sentence
        (the words within each pair should appear in the same order in the output sentence
         as they did in the original sentence.)
    Notes:
      - The order of the sentences you output doesn't matter.
      - You must not output duplicates.
      - Your generated sentence can use a word in the original sentence more than
        once.
    Example:
      - Input: 'the cat and the mouse'
      - Output: ['and the cat and the', 'the cat and the mouse', 'the cat and the cat', 'cat and the cat and']
                (reordered versions of this list are allowed)
    """
    # BEGIN_YOUR_CODE (our solution is 17 lines of code, but don't worry if you deviate from this)
    
    words = sentence.split()
    pairs = set([x for x in zip(words, words[1:])])

    result = []

    def recurse(current_sentence: list = []):
        if len(current_sentence) == len(words):
            result.append(' '.join(current_sentence))
            return 
        for pair in pairs:
            if current_sentence[-1] == pair[0]:
                recurse(current_sentence + [pair[1]])

    for pair in pairs:
        recurse([pair[0], pair[1]])

    return result

    # END_YOUR_CODE