#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 5;
char s[maxn];
char t[maxn];
const int mod = 998244353;
long long dp[maxn][maxn];
int n, m;
long long ans;
int pw[maxn];
long long dp2[maxn][maxn];
int main() {
  pw[0] = 1;
  for (int i = 1; i < maxn; i++) pw[i] = 1ll * pw[i - 1] * 2 % mod;
  cin >> s + 1 >> t + 1;
  n = strlen(s + 1);
  m = strlen(t + 1);
  for (int l = 1; l <= m; l++) {
    for (int i = 1; i <= m; i++) {
      int j = i + l - 1;
      if (j > m) break;
      if (i == j) {
        if (t[i] == s[1]) dp[i][j] = 1;
        continue;
      }
      dp[i][j] += (t[i] == s[l] ? dp[i + 1][j] : 0);
      dp[i][j] += (t[j] == s[l] ? dp[i][j - 1] : 0);
      dp[i][j] %= mod;
    }
  }
  ans = dp[1][m] * 2 % mod * (n - m + 1) % mod;
  for (int j = 1; j <= m; j++) {
    for (int i = n; i >= 1; i--) {
      dp2[i][j] = dp2[i + 1][j];
      if (i == m - j + 1) continue;
      if (s[i] == t[j]) {
        if (j == 1) {
          if (j == m)
            dp2[i][j] += 1ll * (n - i + 1) * pw[i - 1] % mod;
          else
            dp2[i][j] += n - i + 1;
          dp2[i][j] %= mod;
        } else {
          if (j == m) {
            dp2[i][j] += dp2[i + 1][j - 1] * pw[i - 1] % mod;
          } else
            dp2[i][j] += dp2[i + 1][j - 1];
          dp2[i][j] %= mod;
        }
      }
    }
  }
  for (int j = 1; j <= m; j++) {
    if (j == 1) {
      ans += dp2[1][m];
    } else {
      ans += dp2[j][m - j + 1] * dp[m - j + 2][m] * 2 % mod;
    }
    ans %= mod;
  }
  cout << ans << '\n';
}
