When introducing new terms consisting of several words, it is useful to use abbreviations. An abbreviation is a word composed of the first letters of several consecutive words. An abbreviation is called unambiguous if the following two conditions are satisfied:
It corresponds to exactly one sequence of words in the given text (this sequence may appear multiple times in the text);
It does not appear in the text by itself as a word.
For example, in the text "A recursive acronym KINA means "KINA is not abbreviation"", the strings "ARA" and "K" are unambiguous abbreviations, the strings "A" and "KINA" are ambiguous abbreviations, and the strings "RAA" and "KNA" are not abbreviations. To introduce an abbreviation in a text, it is placed in parentheses immediately after the first occurrence of the word sequence to which it corresponds. Subsequent occurrences of this word sequence may be replaced by the abbreviation. In the example above, introducing the abbreviation "K" results in: "A recursive acronym KINA (K) means "K is not abbreviation"".
If several occurrences of a word sequence overlap, only one of them can be replaced by the abbreviation. Words are sequences of consecutive Latin letters separated by non-Latin letters. Words are compared case-insensitively. For example, "i18n" is considered an occurrence of the word sequence "I n". The effectiveness of an abbreviation is defined as the decrease in the number of letters in the text after its introduction. Only Latin letters are considered; spaces, parentheses, and other non-alphabetic characters are not counted.
You are given a text. Find an unambiguous abbreviation with the maximum effectiveness.
The input contains a text of at most characters. The text contains only characters with ASCII codes (space) to (), (carriage return), and (line feed).
If there is no unambiguous abbreviation with positive effectiveness, output the single number . Otherwise, the first line should contain the effectiveness of the optimal abbreviation. The second line should contain the abbreviation itself. If there are multiple unambiguous abbreviations with maximum effectiveness, output any one of them.
Note: In the first example, the optimal abbreviations are "NA" and "INA". In the third example, the optimal abbreviations are "JB" and "BJ".
Example 1