#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
int nextL[MAXN], nextR[MAXN];
int matchL[MAXN], matchR[MAXN];
void getNext(const string& str, int* next) {
  int len = str.length();
  next[0] = len;
  for (int i = 1, po = 1, P = 0; i < len; ++i) {
    if (i + next[i - po] < P)
      next[i] = next[i - po];
    else {
      int& ni = next[i] = P - i;
      if (ni < 0) ni = 0;
      while (i + ni < len && str[ni] == str[i + ni]) ++ni;
      po = i;
      P = i + ni;
    }
  }
}
void getMatch(const string& s, const string& t, int* next, int* match) {
  int sl = s.length(), tl = t.length();
  getNext(t, next);
  for (int i = 0, po = 0, P = 0; i < sl; ++i) {
    if (i + next[i - po] < P)
      match[i] = next[i - po];
    else {
      int& mi = match[i] = P - i;
      if (mi < 0) mi = 0;
      while (i + mi < sl && mi < sl && t[mi] == s[i + mi]) ++mi;
      po = i;
      P = i + mi;
    }
  }
}
const long long mod = 998244353ll;
long long dp[MAXN], sum_dp[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string A, L, R;
  cin >> A >> L >> R;
  getMatch(A, L, nextL, matchL);
  getMatch(A, R, nextR, matchR);
  int len = A.length(), lenL = L.length(), lenR = R.length();
  int jl = 0, kl = A[0] == L[0];
  int jr = 0, kr = A[0] == R[0];
  dp[0] = 1;
  sum_dp[0] = 1;
  for (int i = 1; i <= len; ++i) {
    int pl = i - lenL, pr = i - lenR;
    int bl = i - lenR, br = i - lenL;
    if (pl >= 0) {
      int ml = matchL[pl];
      if (ml < lenL && A[pl + ml] < L[ml]) --br;
    }
    if (pr >= 0) {
      int mr = matchR[pr];
      if (mr < lenR && A[pr + mr] > R[mr]) ++bl;
    }
    dp[i] = 0;
    if (br >= 0 && bl <= br && bl < i) {
      dp[i] += sum_dp[br];
      if (bl > 0) dp[i] -= sum_dp[bl - 1];
      dp[i] %= mod;
    }
    if (A[i - 1] == '0') sum_dp[i - 1] = (sum_dp[i - 1] - dp[i - 1]) % mod;
    sum_dp[i] = (sum_dp[i - 1] + dp[i]) % mod;
  }
  long long ans = (dp[len] + mod) % mod;
  cout << ans << endl;
  return 0;
}
