input: 
  def generateMarkov(text: str) -> str:
      """
      Generate a Markov chain based on the given text input.
  
      >>> generateMarkov('Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, `and what is the use of a book,' thought Alice `without pictures or conversation?')
      'tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was beginning to get very Alice what is the use of a book,' thought Alice `without pictures or conversation?'
      """
  
output:     words = text.split()
      if len(words) < 2:
          return text
      
      import random
      index = random.randint(0, len(words) - 2)
      result = words[index] + ' ' + words[index + 1]
      
      while len(result.split()) < len(words):
          next_word = None
          for i in range(len(words) - 2):
              if words[i] == words[index + 1]:
                  next_word = words[i + 1]
                  break
          if next_word is None:
              break
          result += ' ' + next_word
          index += 1
      
      return result