#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; const ll modc = 998244353; long long mod_exp(long long b, long long e, long long m){ if (e < 0) return 0; if (e > 0 && b == 0) return 0; long long ans = 1; b %= m; while (e > 0){ if ((e & 1LL)) ans = (ans * b) % m; e = e >> 1LL; b = (b*b) % m; } return ans; } ll f(ll x, ll y, ll z, ll w){ ll res; res = (x * mod_exp(2, z, modc) % modc + (z * mod_exp(2, z-1, modc)) % modc) % modc; res *= (y * mod_exp(2, w, modc) % modc + (w * mod_exp(2, w-1, modc)) % modc) % modc; res %= modc; return res; } int main(){ ll ans = 0, N, r0=0, l0=0, rq=0, lq=0; string S; cin >> S; N = S.size(); for (int i=0; i