func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<vector<pair<int, int> > > Adj;   vector<int> Col;   bool DFS(int u, int f) {     Col[u] = 1 + f;     bool pos = 0;     for (auto i : Adj[u]) {       if (Col[i.first]) {         if ((f ^ i.second) == Col[i.first] - 1)           continue;         else           return 1;       }       pos |= DFS(i.first, f ^ i.second);     }     return pos;   }   template <typename T>   T fast_exp(T base, T power, T M = 0) {     if (M) base %= M;     T result = 1;     while (power) {       if (power & 1) result *= base;       power >>= 1;       base *= base;       if (M) {         base %= M;         result %= M;       }     }     return result;   }   long long Calc(string S, int lA, int lB) {     Adj.clear();     Col.clear();     Adj.resize(lA + lB + 1);     Col.resize(lA + lB + 1);     for (int x = 0; x < lA; x++) {       Adj[x].push_back({lA - x - 1, 0});       Adj[lA - x - 1].push_back({x, 0});     }     for (int x = 0; x < lB; x++) {       Adj[lA + x].push_back({lA + lB - x - 1, 0});       Adj[lA + x].push_back({lA + lB - x - 1, 0});     }     for (int x = 0; x < lA; x++) {       if (S[x] ==  ? ) continue;       if (x < lA - lB) {         Adj[x].push_back({lA + lB, S[x] -  0 });         Adj[lA + lB].push_back({x, S[x] -  0 });       } else {         Adj[x].push_back({lB + x, S[x] -  0 });         Adj[lB + x].push_back({x, S[x] -  0 });       }     }     Adj[lA + lB].push_back({lA, 1});     Adj[lA].push_back({lA + lB, 1});     int cnt = 0;     for (int x = 0; x < lA + lB + 1; x++) {       if (Col[x]) continue;       if (DFS(x, 0)) return 0;       cnt++;     }     return fast_exp<long long>(2, cnt - 1, 998244353);   }   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     string S;     cin >> S;     long long ans = 0;     int lA = S.size();     for (int lB = 1; lB < lA; lB++) {       ans += Calc(S, lA, lB);       ans %= 998244353;     }     cout << ans << endl;     return 0;   }   