#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
inline long long add(long long v1, long long v2) {
  v1 += v2;
  if (v1 >= mod) v1 -= mod;
  if (v1 < 0) v1 += mod;
  return v1;
}
inline long long mul(long long v1, long long v2) { return v1 * v2 % mod; }
inline long long mypow(long long v, long long t) {
  long long res = 1;
  while (t) {
    if (t & 1) res = res * v % mod;
    v = v * v % mod;
    t >>= 1;
  }
  return res;
}
inline void bye() {
  puts("");
  exit(0);
}
const int N = 1010101;
int ct[N], he[N], rk[N], sa[N], tsa[N], tp[N][2];
struct SA {
  static const int MXN = 1000010;
  bool _t[MXN * 2];
  int _s[MXN * 2], _sa[MXN * 2], _c[MXN * 2], x[MXN], _p[MXN], _q[MXN * 2],
      hei[MXN], r[MXN];
  int operator[](int i) { return _sa[i]; }
  void build(int *s, int n, int m) {
    memcpy(_s, s, sizeof(int) * n);
    sais(_s, _sa, _p, _q, _t, _c, n, m);
    mkhei(n);
  }
  void mkhei(int n) {
    for (int i = 0; i < int(n); i++) r[_sa[i]] = i;
    hei[0] = 0;
    for (int i = 0; i < int(n); i++)
      if (r[i]) {
        int ans = i > 0 ? max(hei[r[i - 1]] - 1, 0) : 0;
        while (_s[i + ans] == _s[_sa[r[i] - 1] + ans]) ans++;
        hei[r[i]] = ans;
      }
  }
  void sais(int *s, int *sa, int *p, int *q, bool *t, int *c, int n, int z) {
    bool uniq = t[n - 1] = true, neq;
    int nn = 0, nmxz = -1, *nsa = sa + n, *ns = s + n, lst = -1;
    memset((c), 0, z * sizeof(*(c)));
    for (int i = 0; i < int(n); i++) uniq &= ++c[s[i]] < 2;
    for (int i = 0; i < int(z - 1); i++) c[i + 1] += c[i];
    if (uniq) {
      for (int i = 0; i < int(n); i++) sa[--c[s[i]]] = i;
      return;
    }
    for (int i = n - 2; i >= 0; i--)
      t[i] = (s[i] == s[i + 1] ? t[i + 1] : s[i] < s[i + 1]);
    memset((sa), 0, n * sizeof(*(sa)));
    memcpy(x, c, sizeof(int) * z);
    for (int i = (1); i <= int(n - 1); i++)
      if (t[i] && !t[i - 1]) sa[--x[s[i]]] = p[q[i] = nn++] = i;
    memcpy(x + 1, c, sizeof(int) * (z - 1));
    for (int i = 0; i < int(n); i++)
      if (sa[i] && !t[sa[i] - 1]) sa[x[s[sa[i] - 1]]++] = sa[i] - 1;
    memcpy(x, c, sizeof(int) * z);
    for (int i = n - 1; i >= 0; i--)
      if (sa[i] && t[sa[i] - 1]) sa[--x[s[sa[i] - 1]]] = sa[i] - 1;
    ;
    for (int i = 0; i < int(n); i++)
      if (sa[i] && t[sa[i]] && !t[sa[i] - 1]) {
        neq = lst < 0 || memcmp(s + sa[i], s + lst,
                                (p[q[sa[i]] + 1] - sa[i]) * sizeof(int));
        ns[q[lst = sa[i]]] = nmxz += neq;
      }
    sais(ns, nsa, p + nn, q + n, t + n, c + z, nn, nmxz + 1);
    memset((sa), 0, n * sizeof(*(sa)));
    memcpy(x, c, sizeof(int) * z);
    for (int i = nn - 1; i >= 0; i--) sa[--x[s[p[nsa[i]]]]] = p[nsa[i]];
    memcpy(x + 1, c, sizeof(int) * (z - 1));
    for (int i = 0; i < int(n); i++)
      if (sa[i] && !t[sa[i] - 1]) sa[x[s[sa[i] - 1]]++] = sa[i] - 1;
    memcpy(x, c, sizeof(int) * z);
    for (int i = n - 1; i >= 0; i--)
      if (sa[i] && t[sa[i] - 1]) sa[--x[s[sa[i] - 1]]] = sa[i] - 1;
    ;
  }
} Sa;
void suffix_array(int *ip, int len) {
  int l = len;
  ip[len++] = 0;
  Sa.build(ip, len, 128);
  for (int i = 0; i < l; i++) {
    he[i] = Sa.hei[i + 1];
    sa[i] = Sa._sa[i + 1];
  }
  for (int i = 0; i < l; i++) {
    rk[sa[i]] = i;
  }
}
int ss[N];
char s[N];
char s1[N], s2[N];
void init() { scanf("%s %s %s", s, s1, s2); }
void build() {
  int l = strlen(s);
  for (int i = 0; i < l; i++) ss[i] = s[i] - '0' + 1;
  suffix_array(ss, l);
}
int go(char *ss, int typ = 0) {
  int l = strlen(ss), l2 = strlen(s);
  int ll = 0, rr = l2 - 1, res = 0;
  if (!typ)
    res = l2;
  else
    res = -1;
  while (ll <= rr) {
    int mid = (ll + rr) >> 1;
    int check = 0;
    int ed = min(l2, sa[mid] + l);
    for (int i = sa[mid]; i < ed; i++) {
      if (s[i] < ss[i - sa[mid]]) {
        check = 1;
        break;
      } else if (s[i] > ss[i - sa[mid]]) {
        check = -1;
        break;
      }
    }
    if (typ == 0) {
      if (check == -1) {
        rr = mid - 1;
        res = mid;
      } else if (check == 1) {
        ll = mid + 1;
      } else {
        if (l2 >= sa[mid] + l) {
          rr = mid - 1;
          res = mid;
        } else {
          ll = mid + 1;
        }
      }
    } else {
      if (check == -1) {
        rr = mid - 1;
      } else if (check == 1) {
        ll = mid + 1;
        res = mid;
      } else {
        ll = mid + 1;
        res = mid;
      }
    }
  }
  return res;
}
long long dp[N], a[N];
void solve() {
  int l = strlen(s);
  int p1 = go(s1), p2 = go(s2, 1);
  int l1 = strlen(s1), l2 = strlen(s2);
  a[0] = 1;
  int ll = -l2;
  int rr = -l1 - 2;
  long long sum = 0;
  for (int i = 0; i < l; i++) {
    rr++;
    if (rr >= -1) sum = add(sum, a[rr + 1]);
    if (ll >= -1) sum = add(sum, -a[ll + 1]);
    ll++;
    long long v = 0;
    if (l1 == l2) {
      if (i + 1 >= l1) {
        if (p1 <= rk[i + 1 - l1] && rk[i + 1 - l1] <= p2) {
          v = add(v, a[i - l1 + 1]);
        }
      }
    } else {
      if (i + 1 >= l1) {
        if (p1 <= rk[i + 1 - l1]) {
          v = add(v, a[i - l1 + 1]);
        }
      }
      if (i + 1 >= l2) {
        if (p2 >= rk[i + 1 - l2]) {
          v = add(v, a[i - l2 + 1]);
        }
      }
    }
    if (s1[0] == '0' && s[i] == '0') {
      if (i != 0)
        v = add(v, dp[i - 1]);
      else
        v = add(v, 1);
    }
    if (l1 + 1 <= l2 - 1) {
      v = add(v, sum);
    }
    dp[i] = v;
    if (s[i + 1] != '0') a[i + 1] = v;
  }
  printf("%lld\n", dp[l - 1]);
}
int main() {
  init();
  build();
  solve();
  return 0;
}
