input: def generateMarkov(text: str) -> str:
      """Generates a Markov chain from a given text input and produces a new text based on the Markov chain.
  
      >>> 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?')
      'conversations in it, `and what is the use of a book,' thought Alice `without pictures or conversation?'"
      """
output:     import random
  
      words = text.split()
      markov_dict = {}
  
      for i in range(len(words) - 1):
          current_word = words[i]
          next_word = words[i + 1]
  
          if current_word in markov_dict:
              markov_dict[current_word].append(next_word)
          else:
              markov_dict[current_word] = [next_word]
  
      start_word = random.choice(words)
      result = [start_word]
  
      while len(result) < len(words):
          current_word = result[-1]
          if current_word in markov_dict:
              next_word = random.choice(markov_dict[current_word])
              result.append(next_word)
          else:
              break
  
      return ' '.join(result)