{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ consisting of `a`,`b` and `c`. Find the number of strings that can be possibly obtained by repeatedly performing the following operation zero or more times, modulo $998244353$:\n\n*   Choose an integer $i$ such that $1\\leq i\\leq |S|-1$ and the $i$\\-th and $(i+1)$\\-th characters in $S$ are different. Replace each of the $i$\\-th and $(i+1)$\\-th characters in $S$ with the character that differs from both of them (among `a`, `b` and `c`)."},{"iden":"constraints","content":"*   $2 \\leq |S| \\leq 2 × 10^5$\n*   $S$ consists of `a`, `b` and `c`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$S$"},{"iden":"sample input 1","content":"abc"},{"iden":"sample output 1","content":"3\n\n`abc`, `aaa` and `ccc` can be obtained."},{"iden":"sample input 2","content":"abbac"},{"iden":"sample output 2","content":"65"},{"iden":"sample input 3","content":"babacabac"},{"iden":"sample output 3","content":"6310"},{"iden":"sample input 4","content":"ababacbcacbacacbcbbcbbacbaccacbacbacba"},{"iden":"sample output 4","content":"148010497"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}