input: 
  def generateMarkov(text: str) -> str:
      """Generates a Markov chain based on the given text input. The function splits the text into words, 
      constructs a Markov chain where key is a word and value is a dictionary of words that follow it, 
      and generates a text of 100 words (or shorter if broken by the end of the chain).
      
      Example:
      >>> 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?')
      '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 reading, but it had no pictures or conversations in it,'
      """
  
output:     
      import random
      from collections import defaultdict
  
      words = text.split()
      markov_chain = defaultdict(list)
  
      for i in range(len(words) - 1):
          markov_chain[words[i]].append(words[i + 1])
  
      current_word = random.choice(words)
      generated_text = [current_word]
  
      for _ in range(99):
          if current_word not in markov_chain:
              break
          next_word = random.choice(markov_chain[current_word])
          generated_text.append(next_word)
          current_word = next_word
  
      return ' '.join(generated_text)
  