#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
class Solution {
 public:
  int count(const string& A, const string& L, const string& R) {
    int n = A.length();
    int ll = L.length();
    int rl = R.length();
    bool zeroAllowed = false;
    if (L == "0") {
      zeroAllowed = true;
    }
    vector<int> nextL = buildNextTable(A, L);
    vector<int> nextR = buildNextTable(A, R);
    vector<long long> dp(n + 1, 0);
    dp[0] = 1;
    vector<long long> dp2(n + 1, 0);
    if (A[0] == '0') {
      dp2[0] = 1;
    }
    for (int i = 0; i < n; ++i) {
      dp2[i + 1] = dp2[i];
      bool valid = false;
      if (i + 1 == n || A[i + 1] != '0') {
        valid = true;
      }
      int l = ll;
      int r = rl;
      r = min(rl, i + 1);
      if (i - ll + 1 < 0) {
        dp[i + 1] = dp[i];
        continue;
      }
      if (l == ll && nextL[i - ll + 1] < ll) {
        int j = i - ll + 1;
        assert(A[j + nextL[j]] != L[nextL[j]]);
        if (A[j + nextL[j]] < L[nextL[j]]) {
          ++l;
        }
      }
      if (r == rl && nextR[i - rl + 1] < rl) {
        int j = i - rl + 1;
        assert(A[j + nextR[j]] != R[nextR[j]]);
        if (A[j + nextR[j]] > R[nextR[j]]) {
          --r;
        }
      }
      if (l <= r) {
        l = max(0, i - l + 1);
        r = max(0, i - r + 1);
        swap(l, r);
        dp[i + 1] = (M + (dp[r] - (l - 1 >= 0 ? dp[l - 1] : 0)) % M) % M;
        if (r == i && zeroAllowed && A[i] == '0') {
          --r;
        }
        dp[i + 1] =
            (M + (dp[i + 1] - (dp2[r] - (l - 1 >= 0 ? dp2[l - 1] : 0))) % M) %
            M;
      }
      if (!valid) {
        dp2[i + 1] = (dp2[i] + dp[i + 1]) % M;
      }
      dp[i + 1] = (dp[i] + dp[i + 1]) % M;
    }
    long long res = (dp[n] - dp[n - 1]) % M;
    if (res < 0) {
      res += M;
    }
    return res;
  }

 private:
  vector<int> buildNextTable(const string& s, const string& t) {
    int maxLen = t.length();
    int n = s.length();
    int m = t.length();
    vector<pair<long long, long long>> pms = {
        {317, 1e9 + 7}, {731, 1e9 + 9}, {53, 1e9 + 7},
        {23, 1e9 + 7},  {43, 1e9 + 9},  {59, 1e9 + 9},
    };
    auto pm = pms[rand() % pms.size()];
    auto p = pm.first;
    auto mod = pm.second;
    vector<long long> fps(m + 1, 0);
    vector<long long> pows(m + 1, 1);
    for (int i = 0; i < m; ++i) {
      fps[i + 1] = (fps[i] * p + t[i]) % mod;
      pows[i + 1] = (pows[i] * p) % mod;
    }
    vector<long long> fps2(n + 1, 0);
    for (int i = 0; i < n; ++i) {
      fps2[i + 1] = (fps2[i] * p + s[i]) % mod;
    }
    vector<int> res(n, 0);
    for (int i = 0; i < n; ++i) {
      int l = 0, r = min(m, n - i);
      while (l < r) {
        int mi = l + (r - l + 1) / 2;
        long long h = (fps2[i + mi] - fps2[i] * pows[mi]) % mod;
        if (h < 0) {
          h += mod;
        }
        if (h == fps[mi]) {
          l = mi;
        } else {
          r = mi - 1;
        }
      }
      res[i] = l;
    }
    return res;
  }
  vector<int> buildNextTable2(const string& s, const string& t) {
    int n = s.length();
    int m = t.length();
    vector<int> res(n, 0);
    for (int i = 0; i < n; ++i) {
      int l = 0;
      for (; l < m && i + l < n && s[i + l] == t[l]; ++l) {
      }
      res[i] = l;
    }
    return res;
  }
  void check(const string& s, int l, int r, int p, const string& L,
             const string& R) {
    auto cmp = [](const string& l, const string& r) {
      if (l.length() == r.length()) {
        return l < r;
      }
      return l.length() < r.length();
    };
    for (int i = l; i <= r; ++i) {
      string t = s.substr(i, p - i + 1);
      if (cmp(t, L)) {
        cout << "ERROR: " << t << " < " << L << endl;
      }
      if (cmp(R, t)) {
        cout << "ERROR: " << t << " > " << R << endl;
      }
    }
  }
};
int main(int argc, char** argv) {
  const int N = 1e6 + 1000;
  char buf[N] = {0};
  scanf("%s", buf);
  string a(buf);
  scanf("%s", buf);
  string l(buf);
  scanf("%s", buf);
  string r(buf);
  Solution sol;
  cout << sol.count(a, l, r) << endl;
  return 0;
}
