input: 
  def frequent_words(words, n):
      """
      Given a list of words and an integer n, returns a list of words that appear at least n times in the given list.
      >>> frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3)
      ['a', 'd']
      >>> frequent_words(['apple', 'banana', 'apple', 'banana', 'cherry'], 2)
      ['apple', 'banana']
      """
      from collections import Counter
      counts = Counter(words)
      return [word for word, count in counts.items() if count >= n]
  
output:     from collections import Counter
      counts = Counter(words)
      return [word for word, count in counts.items() if count >= n]