input: Write a function to generate a list of words that appear at least n times in a given list of words. If the list is empty, return an empty list.
  assert frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3)==['a', 'd']
  assert frequent_words(['x', 'y', 'x', 'y', 'z'], 2)==['x', 'y']
  assert frequent_words(['p', 'q', 'r'], 1)==['p', 'q', 'r']
  assert frequent_words([], 2)==[]
  assert frequent_words(['apple', 'banana', 'apple', 'banana', 'cherry', 'banana'], 3)==['banana']
output: def frequent_words(words, n):
      from collections import Counter
      if not words:
          return []
      word_counts = Counter(words)
      return [word for word, count in word_counts.items() if count >= n]