input: from typing import Dict
  
  def generateMarkov(text: str) -> str:
      """ Generates a Markov chain from a given text input and generates a new text based on the 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?')
      'sitting Alice was beginning to get very tired of having nothing to do: once or twice she had peeped into the bank, and of the book her sister on it,`and what is the use of a book,'thought Alice `without pictures or conversation?'
      """
output:     
      import random
      from collections import defaultdict
  
      def generateMarkov(text: str) -> str:
          words = text.split()
          markov_dict = defaultdict(list)
  
          for i in range(len(words) - 1):
              markov_dict[words[i]].append(words[i + 1])
  
          start_word = random.choice(words)
          while start_word.islower():
              start_word = random.choice(words)
  
          result = [start_word]
          current_word = start_word
  
          for _ in range(len(words) - 1):
              if current_word not in markov_dict:
                  break
              next_word = random.choice(markov_dict[current_word])
              result.append(next_word)
              current_word = next_word
  
          return ' '.join(result)
  