input: Write a function to generate a Markov chain and produce text based on the input text. The function should take a single string input and return a string that is a generated text based on the Markov chain. Return an empty string if the input text is empty or if the generated text is unable to be produced.
  assert 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?') != ""
  assert generateMarkov('') == ""
  assert generateMarkov('a b a b') != ""
output: import random
  
  def generateMarkov(text):
      if not text:
          return ""
      
      words = text.split()
      if len(words) < 2:
          return ""
      
      chain = {}
      for i in range(len(words) - 1):
          current_word = words[i]
          next_word = words[i + 1]
          if current_word in chain:
              chain[current_word].append(next_word)
          else:
              chain[current_word] = [next_word]
      
      start_word = random.choice(words)
      while start_word not in chain:
          start_word = random.choice(words)
      
      result = [start_word]
      current_word = start_word
      for _ in range(100):
          if current_word not in chain:
              break
          next_word = random.choice(chain[current_word])
          result.append(next_word)
          current_word = next_word
      
      return ' '.join(result)