#include <bits/stdc++.h>
const int N = 1000005, mu = 998244353;
void reduce(int &x) { x += x >> 31 & mu; }
char a[N], l[N], r[N];
int len, lcp1[N], lcp2[N], next[N], L, llen, rlen, dp[N], pre[N];
void getnext(char *s) {
  int len = strlen(s);
  next[0] = len;
  int i = 0, p0 = 1;
  while (s[i] == s[i + 1] && i + 1 < len) i++;
  next[1] = i;
  for (i = 2; i < len; i++) {
    if (next[i - p0] + i - p0 < next[p0])
      next[i] = next[i - p0];
    else {
      int j = p0 + next[p0] - i;
      if (j < 0) j = 0;
      while (i + j < len && s[j] == s[i + j]) j++;
      next[i] = j;
      p0 = i;
    }
  }
}
void exkmp(char *s, char *p, int *ex) {
  getnext(p);
  int plen = strlen(p);
  int i = 0, p0 = 0;
  while (s[i] == p[i] && i < plen && i < L) i++;
  ex[0] = i;
  for (int i = 1; i < L; i++) {
    if (next[i - p0] + i - p0 < ex[p0])
      ex[i] = next[i - p0];
    else {
      int j = p0 + ex[p0] - i;
      if (j < 0) j = 0;
      while (i + j < L && j < plen && p[j] == s[i + j]) j++;
      ex[i] = j;
      p0 = i;
    }
  }
}
int main() {
  scanf("%s%s%s", a, l, r);
  L = strlen(a), llen = strlen(l), rlen = strlen(r);
  exkmp(a, l, lcp1), exkmp(a, r, lcp2);
  for (int i = 0; i < L; i++) {
    if (i >= llen - 1) {
      int pl = -1, pr = i - llen;
      if (lcp1[pr + 1] < llen && l[lcp1[pr + 1]] > a[pr + 1 + lcp1[pr + 1]])
        pr--;
      if (i >= rlen - 1) {
        pl = i - rlen;
        if (lcp2[pl + 1] < rlen && r[lcp2[pl + 1]] < a[pl + 1 + lcp2[pl + 1]])
          pl++;
      };
      if (pl == -1 && pr >= -1) dp[i] += 1;
      pl = std::max(pl, 0);
      if (pl <= pr) {
        reduce(dp[i] += pre[pr] - mu);
        if (pl) reduce(dp[i] -= pre[pl - 1]);
      }
      if (l[0] == '0' && a[i] == '0') reduce(dp[i] += dp[i - 1] - mu);
    }
    if (i) pre[i] = pre[i - 1];
    if (i < L - 1 && a[i + 1] != '0') reduce(pre[i] += dp[i] - mu);
  }
  printf("%d\n", dp[L - 1]);
}
