#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( avx,avx2,fma )   #pragma GCC optimization( unroll-loops )   using namespace std;   const int MX = 3003;   const int M = 998244353;   char s[MX], t[MX];   int n, m, ans, dp[MX][MX];   int f(int i, int j) {     if (i < 1 && j > n) return 1;     if (dp[i][j] == -1) {       int p = 0, q = 0, r = (i == j);       int k = j - i + r, x = (i < 1 && j > m);       if (i) {         if (i <= m)           p = (s[k] == t[i]) ? f(i - 1, j + r) : 0;         else           p = f(i - 1, j + r);       }       if (j <= n) {         if (j <= m)           q = (s[k] == t[j]) ? f(i - r, j + 1) : 0;         else           q = f(i - r, j + 1);       }       int y = (p + q < M) ? (p + q) : (p + q - M);       dp[i][j] = (x + y < M) ? (x + y) : (x + y - M);     }     return dp[i][j];   }   int main() {     scanf( %s %s , s + 1, t + 1);     n = strlen(s + 1), m = strlen(t + 1);     memset(dp, -1, sizeof(dp));     for (int i = 1; i <= n; i++) ans = (ans + f(i, i)) % M;     printf( %d n , ans);     return 0;   }   