#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum;
}
const int maxn = 1000005, mod = 998244353;
int n, lenL, lenR, tmp[maxn], el[maxn], er[maxn], sum[maxn], f;
char s[maxn], L[maxn], R[maxn];
void get_next(char *s, int *nxt) {
  int pos, p = 1, n;
  n = strlen(s + 1);
  nxt[1] = n;
  while (s[p] == s[p + 1]) ++p;
  nxt[pos = 2] = p - 1;
  for (int i = 3; i <= n; ++i) {
    int len = nxt[i - pos + 1];
    if (len < p - i + 1)
      nxt[i] = len;
    else {
      int j = max(0, p - i + 1);
      while (i + j <= n && s[j + 1] == s[i + j]) ++j;
      p = i + (nxt[pos = i] = j) - 1;
    }
  }
}
void exkmp(char *s, char *t, int *nxt, int *extend) {
  int pos, p = 0, n, m;
  while (t[p + 1] == s[p + 1]) ++p;
  extend[pos = 1] = p;
  n = strlen(s + 1);
  m = strlen(t + 1);
  for (int i = 2; i <= n; ++i) {
    int len = nxt[i + 1 - pos];
    if (len < p - i + 1)
      extend[i] = len;
    else {
      int j = max(0, p - i + 1);
      while (p < n && j < m && s[i + j] == t[j + 1]) ++p, ++j;
      p = i + (extend[pos = i] = j) - 1;
    }
  }
}
inline void inc(int &a, int b) {
  if ((a += b) >= mod) a -= mod;
}
inline bool cmp1(int l, int r, char *S, int *lcp) {
  if (l + lcp[l] > r)
    return 1;
  else
    return s[l + lcp[l]] >= S[lcp[l] + 1];
}
inline bool cmp2(int l, int r, char *S, int *lcp) {
  if (l + lcp[l] > r)
    return 1;
  else
    return s[l + lcp[l]] <= S[lcp[l] + 1];
}
int main() {
  scanf("%s", s + 1);
  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);
  f = 1;
  sum[1] = mod - 1;
  for (int i = 1; i <= n; ++i) {
    int l, r;
    if (s[i] == '0') {
      if (L[1] == '0')
        l = r = i;
      else {
        inc(f, sum[i]);
        continue;
      }
    } else {
      l = i + lenL - 1;
      if (!cmp1(i, l, L, el)) ++l;
      r = i + lenR - 1;
      if (!cmp2(i, r, R, er)) --r;
    }
    if (l <= r) inc(sum[l], f), inc(sum[r + 1], mod - f);
    inc(f, sum[i]);
  }
  printf("%d\n", f);
  return 0;
}
