#C600. Common Words Finder

    ID: 49712 Type: Default 1000ms 256MiB

Common Words Finder

Common Words Finder

You are given a set of documents. A document is a string that may include letters, numbers, and punctuation. A word is defined as a contiguous sequence of alphabetical characters. Your task is to identify all words that appear in every document, treating uppercase and lowercase letters as equivalent. If there is at least one common word, output the sorted list of these common words in lexicographical order separated by a single space; otherwise, output exactly No common words.

Note: A word is extracted using the regular expression (\b[a-zA-Z]+\b).

inputFormat

The first line of input contains an integer T, which is the number of documents. Each of the following T lines contains a document (a string).

outputFormat

If common words exist, output them in lexicographical order separated by a single space. If there are no common words, output exactly "No common words".## sample

2
Scientific research is fascinating.
Data analysis reveals surprising results.
No common words