When writing an article, there is usually an abstract that summarizes the whole article. We are experimenting with an algorithm that generates such an abstract automatically. The algorithm reads an article and produces an abstract that summarizes it. The abstract is formed by joining the topic sentences taken from consecutive paragraphs.
For this problem:
. (period), ?, or !, and contains no other occurrence of ., ?, or !. A single sentence may span several lines.Here maximal means we take only the longest sequence that matches the definition, not any of its subsequences. For example, the sentence "How now, brown cow?" contains four words. "now" is a word, but "no" and "ow" are not, because they are subsequences of a longer sequence of alphabetic characters.
The topic sentence of a paragraph is the single sentence that best describes the paragraph. We choose it as follows: for each sentence S, count the distinct words in S that also occur in some later sentence of the same paragraph; the topic sentence is the earliest sentence that maximizes this count.
Paragraphs with fewer than three sentences are ignored and do not contribute to the abstract.
When comparing words, differences in upper and lower case are ignored. For example, the sentence "See what I see." contains three distinct words, not four.
The input consists of one or more articles. Each article is terminated by a line containing only *** or ******. The latter (******) marks the end of the entire input.
*** or ****** markers described above.For each article, print its abstract followed by a line containing ====== (six equal signs).
Each abstract is formed from the topic sentences, selected as described above, in the order they occur in the article. Print each sentence exactly as it appears in the input, followed by a line break.