{"raw_statement":[{"iden":"problem statement","content":"A string $T$ is called a **good string** when it satisfies the following condition:\n\n*   There is a pair of strings $(A, B)$ that satisfies all of the following:\n    *   Both $A$ and $B$ are non-empty.\n    *   $A + B = T$.\n    *   Both $A + \\mathrm{rev}(B)$ and $\\mathrm{rev}(A) + B$ are palindromes.\n\nHere, $A + B$ denotes the string formed by concatenating strings $A$ and $B$ in this order.  \nAlso, $\\mathrm{rev}(A)$ denotes the string formed by reversing the order of the characters in string $A$.\nThere is a string $S$ of length $N$ consisting of lowercase English letters and the character `?`.  \nAmong the $26^{(\\text{number of ?s})}$ ways to replace the `?`s in $S$ with lowercase English letters, how many result in a good string? Find the count modulo $998244353$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 5 \\times 10^4$\n*   $S$ is a string of length $N$ consisting of lowercase English letters and `?`."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$S$"},{"iden":"sample input 1","content":"4\n?ba?"},{"iden":"sample output 1","content":"1\n\nThe string `abab` is good, because if we set $A =$ `ab` and $B =$ `ab`, then $A + B =$ `abab`, and both $A + \\mathrm{rev}(B) =$ `abba` and $\\mathrm{rev}(A) + B =$ `baab` are palindromes.  \nAmong the strings that can be formed by replacing the `?`s in $S$ with lowercase English letters, there is only one good string, which is `abab`."},{"iden":"sample input 2","content":"10\n?y?x?x????"},{"iden":"sample output 2","content":"676"},{"iden":"sample input 3","content":"30\n???a?????aab?a???c????c?aab???"},{"iden":"sample output 3","content":"193994800"},{"iden":"sample input 4","content":"36\n????????????????????????????????????"},{"iden":"sample output 4","content":"363594614"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}