A string is considered a pattern of another string if the combined occurrences of within completely cover . This means that every position in is covered by at least one occurrence of . For example, the string is a pattern for .
A string is defined as a pseudo-pattern of a string if it meets the following criteria:
It is a substring of .
It is a pattern of some string that contains .
For example, the string is a pseudo-pattern of because it appears as a substring and serves as a pattern for the string .
Given a string , your task is to determine the number of its pseudo-patterns and identify the shortest one.
The input consists of a single string with a length ranging from to 2 \cdot 10^5, composed of lowercase Latin letters.
On the first line, output the total number of pseudo-patterns for the given string. On the second line, output the shortest pseudo-pattern. If there are multiple pseudo-patterns of the shortest length, choose the lexicographically smallest one.
Example 1