input: from typing import List, Dict
  
  def generateMarkov(text: str) -> str:
      """ Generate a Markov chain from the given text input and produce a new text based on the chain.
      The function splits the input text into words, builds a Markov chain based on the frequency of word pairs,
      and then generates a new text of up to 100 words using the Markov chain.
      
      >>> generateMarkov('Alice was beginning to get very tired')
      'beginning to get very tired Alice was beginning to get very tired'
      
      >>> generateMarkov('A quick brown fox jumps over the lazy dog')
      'brown fox jumps over the lazy dog A quick brown fox jumps over the lazy dog'
      """
      words = text.split(' ')
      markovChain = {}
  
      for i in range(len(words) - 2):
          current = words[i]
          next = words[i + 1]
          if current in markovChain:
              if next in markovChain[current]:
                  markovChain[current][next] += 1
              else:
                  markovChain[current][next] = 1
          else:
              markovChain[current] = {next: 1}
  
      generatedText = ""
      current = random.choice(list(markovChain))
      generatedText += current
  
      for i in range(100):
          choices = markovChain[current]
          choices = [
              key for key, value in choices.items()
              for i in range(value)
          ]
          try:
              current = random.choice(choices)
              generatedText += " " + current
          except:
              break
  
      return generatedText
output:     import random
  
      words = text.split(' ')
      markovChain = {}
  
      for i in range(len(words) - 1):
          current = words[i]
          next = words[i + 1]
          if current in markovChain:
              if next in markovChain[current]:
                  markovChain[current][next] += 1
              else:
                  markovChain[current][next] = 1
          else:
              markovChain[current] = {next: 1}
  
      generatedText = ""
      current = random.choice(list(markovChain))
      generatedText += current
  
      for i in range(100):
          if current not in markovChain:
              break
          choices = markovChain[current]
          next = random.choices(list(choices.keys()), weights=list(choices.values()))[0]
          generatedText += " " + next
          current = next
  
      return generatedText