ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

## 2057. Non-palidromic cutting

Time limit: 1.0 second
Memory limit: 64 MB
Alyosha splits into non-palindromic factors. On some days Alyosha feels like he is tired, so he just split a string in minimal number of palindromes. In other days Alyosha is full of energy and he splits a string in maximal amount of palindromes. There is an option to split a string in one piece that means to leave it as it was. Can you determine how much factors will have Alyosha depending on his mood?

### Input

The only line contains a string of n English letters (1 ≤ n ≤ 2 · 105).

### Output

If there is no way to cut this string into non-palindromes, output “-1”.
Otherwise output the minimal and maximal amount of non-palindromes in splitting.

### Samples

inputoutput
`a`
`-1`
`abba`
`2 2`
`babcbcb`
`1 2`

### Notes

A palindrome is a string which equals its reversal. A non-palindrome is a string that is not a palindrome. For example, “abacaba” is a palindrome, а “abcde” is a non-palindrome.
Problem Author: Nikita Sivukhin
Problem Source: Palindromic Contest, July 11, 2015