Consider a word
w consisting of
n symbols. We can
decompose it at point
i (1 ≤
i ≤
n − 1) into a prefix
p
of length
i and a suffix
s of length
n −
i.
Local root of a word
w at point
i is a non-empty word
r such that:
- p is a suffix of r, or r is a suffix of p, or r is equal to p;
- s is a prefix of r, or r is a prefix of s, or r is equal to s;
- r has minimal possible length.
Your goal is to find such a point that the length of local root at this point is maximal possible.
Input
The only line contains a word w consisting of lowercase English letters. Its length is at least two and at most 300 000 symbols.
Output
Output the required point of decomposition and the length of local root at this point. If there are several possible answers,
output any of them.
Sample
Notes
Local roots of a word “aababaaa” at different points:
Point |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Local root |
a |
babaa |
ab |
ba |
aaabab |
a |
a |
Problem Author: Ivan Burmistrov
Problem Source: Ural SU Contest. Petrozavodsk Summer Session, August 2010