for word in words: for pattern in patterns: if word.issubset(pattern):