Find the longest substring of the given string that is not a palindrome.
A string of characters is given. The number of characters in the string does not exceed 10^5.
Output the length of the longest non-palindromic substring. If no such substring exists, output -1.
Example 1