#K2006. Key Sentences Extraction

    ID: 24640 Type: Default 1000ms 256MiB

Key Sentences Extraction

Key Sentences Extraction

You are given p paragraphs. For each paragraph, your task is to identify the key sentence, defined as the sentence with the highest number of unique words. In the event of a tie, choose the sentence that appears first in the paragraph.

A paragraph is a string that may contain multiple sentences separated by . (a period followed by a space). Note that each sentence in the output must end with a period ('.'), even if the sentence originally did not end with one. If a paragraph is empty, output an empty line for that paragraph.

Formally, if we denote a sentence as a sequence of words, the unique word count of a sentence is equal to the number of distinct words in it. The key sentence from a paragraph \(P\) is the one, \(S\), for which \(f(S)\) is maximized, where \(f(S)\) is the unique word count in \(S\). If \(P\) is empty then the output is an empty string.

inputFormat

The input is given via stdin with the following format:

  1. The first line contains an integer \(p\) representing the number of paragraphs.
  2. The following \(p\) lines each contain a paragraph.

outputFormat

Output the key sentence for each paragraph on a new line via stdout. Each extracted key sentence should end with a period.

## sample
1
climate change is a significant issue. it affects many species.
climate change is a significant issue.

</p>