#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 20;
const int mod = 998244353;
inline void mkay(int &a) {
  a %= mod;
  if (a >= mod)
    a -= mod;
  else if (a < 0)
    a += mod;
}
int dp[maxn], ZL[maxn], ZR[maxn], sum[maxn];
void getZarr(string str, int Z[]) {
  int n = str.size();
  int L, R, k;
  L = R = 0;
  for (int i = 1; i < n; ++i) {
    if (i > R) {
      L = R = i;
      while (R < n && str[R - L] == str[R]) R++;
      Z[i] = R - L;
      R--;
    } else {
      k = i - L;
      if (Z[k] < R - i + 1)
        Z[i] = Z[k];
      else {
        L = i;
        while (R < n && str[R - L] == str[R]) R++;
        Z[i] = R - L;
        R--;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string a, l, r;
  cin >> a >> l >> r;
  int n = a.size(), ml = l.size(), mr = r.size();
  string tmp = l + '#' + a;
  getZarr(tmp, ZL);
  for (int i = 0; i < n; i++) ZL[i] = ZL[i + ml + 1];
  tmp = r + '#' + a;
  getZarr(tmp, ZR);
  for (int i = 0; i < n; i++) ZR[i] = ZR[i + mr + 1];
  dp[n] = 1;
  sum[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    mkay(dp[i] = sum[i + ml] - sum[i + mr + 1]);
    bool f1 = 0, f2 = 0;
    if (i + ml <= n && ZL[i] != ml && a[i + ZL[i]] < l[ZL[i]]) {
      mkay(dp[i] -= dp[i + ml]);
      f1 = 1;
    }
    if (i + mr <= n && ZR[i] != mr && a[i + ZR[i]] > r[ZR[i]]) {
      mkay(dp[i] -= dp[i + mr]);
      f2 = 1;
    }
    if (ml == mr && (f1 || f2)) dp[i] = 0;
    if (a[i] == '0') dp[i] = 1LL * (l == "0") * dp[i + 1] % mod;
    mkay(sum[i] = sum[i + 1] + dp[i]);
  }
  cout << dp[0] << endl;
}
