{"raw_statement":[{"iden":"problem statement","content":"We have a string $s$ consisting of lowercase English letters. Snuke can perform the following operation repeatedly:\n\n*   Insert a letter `x` to any position in $s$ of his choice, including the beginning and end of $s$.\n\nSnuke's objective is to turn $s$ into a palindrome. Determine whether the objective is achievable. If it is achievable, find the minimum number of operations required."},{"iden":"notes","content":"A _palindrome_ is a string that reads the same forward and backward. For example, `a`, `aa`, `abba` and `abcba` are palindromes, while `ab`, `abab` and `abcda` are not."},{"iden":"constraints","content":"*   $1 \\leq |s| \\leq 10^5$\n*   $s$ consists of lowercase English letters."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$s$"},{"iden":"sample input 1","content":"xabxa"},{"iden":"sample output 1","content":"2\n\nOne solution is as follows (newly inserted `x` are shown in bold):\nxabxa → xa**x**bxa → xaxbxa**x**"},{"iden":"sample input 2","content":"ab"},{"iden":"sample output 2","content":"\\-1\n\nNo sequence of operations can turn $s$ into a palindrome."},{"iden":"sample input 3","content":"a"},{"iden":"sample output 3","content":"0\n\n$s$ is a palindrome already at the beginning."},{"iden":"sample input 4","content":"oxxx"},{"iden":"sample output 4","content":"3\n\nOne solution is as follows:\noxxx → **x**oxxx → **x**xoxxx → **x**xxoxxx"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}