#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, T b) {
  return b > a ? a = b, 1 : 0;
}
inline int read() {
  int x(0), sgn(1);
  char ch(getchar());
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') sgn = -1;
  for (; isdigit(ch); ch = getchar()) x = (x * 10) + (ch ^ 48);
  return x * sgn;
}
void File() {}
void Get_Next(char *S, int *next) {
  int lenS = strlen(S + 1), pos = 1, p = 1;
  next[1] = lenS;
  while (p + 1 <= lenS && S[p] == S[p + 1]) ++p;
  next[pos = 2] = p - 1;
  for (register int i = (3), iend = (int)(lenS); i <= iend; ++i) {
    int len = next[i - pos + 1];
    if (len + i < p + 1)
      next[i] = len;
    else {
      int j = max(p - i + 1, 0);
      while (i + j <= lenS && S[j + 1] == S[i + j]) ++j;
      p = i + (next[pos = i] = j) - 1;
    }
  }
}
void ExKMP(char *S, char *T, int *next, int *extend) {
  int lenS = strlen(S + 1), lenT = strlen(T + 1), p = -1, pos = 1;
  for (register int i = (1), iend = (int)(lenS); i <= iend; ++i) {
    int &j = extend[i];
    if (i <= p) j = min(p - i + 1, next[i - pos + 1]);
    while (i + j <= lenS && j < lenT && T[j + 1] == S[i + j]) ++j;
    if (chkmax(p, i + j - 1)) pos = i;
  }
}
const int N = 1e6 + 1e3, Mod = 998244353;
inline void Add(int &a, int b) {
  if ((a += b) >= Mod) a -= Mod;
}
char S[N], L[N], R[N];
template <typename T>
inline int dcmp(T lhs, T rhs) {
  return (lhs > rhs) - (lhs < rhs);
}
inline int Cmp(int l, int r, char *cmp, int *Lcp, int len) {
  if (r - l + 1 != len) return dcmp(r - l + 1, len);
  return l + Lcp[l] > r ? 0 : dcmp(S[l + Lcp[l]], cmp[Lcp[l] + 1]);
}
int lenL, lenR, tmp[N], EL[N], ER[N];
inline bool Check(int x, int y) {
  return Cmp(x, y, L, EL, lenL) >= 0 && Cmp(x, y, R, ER, lenR) <= 0;
}
int tag[N], dp = 1;
int main() {
  File();
  scanf("%s", S + 1);
  int n = strlen(S + 1);
  scanf("%s", L + 1);
  lenL = strlen(L + 1);
  Get_Next(L, tmp);
  ExKMP(S, L, tmp, EL);
  scanf("%s", R + 1);
  lenR = strlen(R + 1);
  Get_Next(R, tmp);
  ExKMP(S, R, tmp, ER);
  tag[1] = Mod - 1;
  for (register int i = (1), iend = (int)(n); i <= iend; ++i) {
    int l, r;
    if (S[i] == '0') {
      if (L[1] == '0')
        l = r = i;
      else {
        Add(dp, tag[i]);
        continue;
      }
    } else {
      l = i + lenL - 1;
      if (!Check(i, l)) ++l;
      r = i + lenR - 1;
      if (!Check(i, r)) --r;
    }
    if (l <= r) Add(tag[l], dp), Add(tag[r + 1], Mod - dp);
    Add(dp, tag[i]);
  }
  printf("%d\n", (dp + Mod) % Mod);
  return 0;
}
