Distinct Words and Lexicographic Extremes
Analyze the whitespace-separated words in a nonempty line.
Input
The input contains one line of letters and spaces. Consecutive spaces are separators and are ignored.
$1 \le |s| \le 10^6$; the line contains letters and spaces and at least one word. Comparisons are case-sensitive.
Output
Print the number of distinct words. On the next line print the lexicographically smallest and largest words.
Example
Input
ngo ngoc an nguyen an ngoc ngoc
Output
4
an nguyen
Comments