Suffix Tree - Application 2 - Longest Repeated Substrings

hard
Given a string print all the start indexes of longest repeated substrings. Refer to video for more info

Input Format

A string s

Output Format

Print the length of Longest repeated substring and in next line print all the start indexes

Constraints

|S| <= 10^5

Example

Input
pepapep
Output
3
0 4
Previous
Sufix Tree - Application 1 - Pattern Find
Next
Suffix Tree - Application 3 - Longest Common Substring

Related Questions