input: from typing import List
  
  
  def generateMarkov(text: str) -> str:
      """ Given a text input, generate a Markov chain and produce a text output.
      >>> 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?')
      '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'
      """
output:     
      words = text.split()
      markov_dict = {}
      for i in range(len(words) - 1):
          if words[i] not in markov_dict:
              markov_dict[words[i]] = []
          markov_dict[words[i]].append(words[i + 1])
      
      output = []
      current_word = words[0]
      output.append(current_word)
      
      while current_word in markov_dict and len(output) < len(words):
          next_word = markov_dict[current_word][0]
          output.append(next_word)
          current_word = next_word
      
      return ' '.join(output)
  