#include <bits/stdc++.h>
using namespace std;
static mt19937 __gen(chrono::steady_clock::now().time_since_epoch().count());
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
constexpr int inf = 0x3f3f3f3f;
constexpr ll lnf = 0x3f3f3f3f3f3f3f3f;
constexpr int mod = 998244353;
inline int add(int x, int y) { return (x += y) >= mod ? x - mod : x; }
inline void inc(int &x, int y) { (x += y) >= mod && (x -= mod); }
constexpr int Maxn = 2000005;
int n, ln, rn;
char a[Maxn], l[Maxn], r[Maxn];
int zl[Maxn], zr[Maxn];
inline void buildZ(int n, const char *s, int *z) {
  for (register int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = (z[i - l] < r - i + 1 ? z[i - l] : r - i + 1);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
}
inline int cmp(int len, int *z, const char *s, int pos) {
  if (n - pos + 1 < len) return -1;
  int x = z[pos + len + 1];
  if (x == len) return 0;
  return a[pos + x] < s[1 + x] ? -1 : 1;
}
int dp[Maxn], suf[Maxn];
signed main() {
  scanf("%s%s%s", a + 1, l + 1, r + 1);
  n = strlen(a + 1);
  ln = strlen(l + 1);
  rn = strlen(r + 1);
  l[ln + 1] = r[rn + 1] = '$';
  strcat(l + 1, a + 1);
  strcat(r + 1, a + 1);
  buildZ(ln + 1 + n, l + 1, zl + 1);
  buildZ(rn + 1 + n, r + 1, zr + 1);
  dp[n + 1] = suf[n + 1] = 1;
  for (int i = n; i >= 1; --i) {
    if (a[i] == '0') {
      if (l[1] == '0')
        dp[i] = dp[i + 1];
      else
        dp[i] = 0;
      suf[i] = add(suf[i + 1], dp[i]);
      continue;
    }
    int cmpl = cmp(ln, zl, l, i);
    int cmpr = cmp(rn, zr, r, i);
    int L = min(ln + i + (cmpl == -1), n + 2);
    int R = min(rn + i - (cmpr == 1), n + 2);
    dp[i] = (L <= R) ? add(suf[L], mod - suf[R + 1]) : 0;
    suf[i] = add(suf[i + 1], dp[i]);
  }
  printf("%d\n", dp[1]);
  return 0;
}
