input: from typing import List
  
  def autocomplete(input_text: str) -> List[str]:
      """ Develop a Python program to create an autocomplete system that predicts words 
      based on the input text. The function should generate word candidates, 
      filter them based on certain criteria, rank them, and return the top 5 words.
      >>> autocomplete("ex")
      ['example', 'exercise', 'excellent', 'exception', 'expensive']
      >>> autocomplete("pr")
      ['prevail', 'provide', 'progress', 'produce', 'press']
      """
output:     word_candidates = ['example', 'exercise', 'excellent', 'exception', 'expensive', 'prevail', 'provide', 'progress', 'produce', 'press']
      filtered_words = [word for word in word_candidates if word.startswith(input_text)]
      ranked_words = sorted(filtered_words, key=lambda word: (-len(word), word))
      return ranked_words[:5]