#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 9, P = 131, p = 998244353;
long long hsh[1000010], hsh2[1000010], hsh3[1000010], Pow[1000010], dp[1000010],
    sum[1000010];
char s1[1000010], s2[1000010], s3[1000010];
int main() {
  scanf("%s%s%s", s1 + 1, s2 + 1, s3 + 1), Pow[0] = 1;
  int n = strlen(s1 + 1), n2 = strlen(s2 + 1), n3 = strlen(s3 + 1);
  for (int i = 1; i <= n; i++)
    Pow[i] = Pow[i - 1] * P % mod,
    hsh[i] = (hsh[i - 1] * P % mod + s1[i] - '0') % mod;
  for (int i = 1; i <= n2; i++)
    hsh2[i] = (hsh2[i - 1] * P % mod + s2[i] - '0') % mod;
  for (int i = 1; i <= n3; i++)
    hsh3[i] = (hsh3[i - 1] * P % mod + s3[i] - '0') % mod;
  dp[n + 1] = sum[n + 1] = 1;
  for (int i = n; i >= 1; i--) {
    sum[i] = (sum[i] + sum[i + 1]) % p;
    if (n - i + 1 < n2) continue;
    if (s1[i] == '0') {
      if (s2[1] == '0') dp[i] = (dp[i] + dp[i + 1]) % p;
    } else {
      int l = 1, r = n2, mid, ans = 0;
      while (l <= r) {
        mid = (l + r) >> 1;
        if ((hsh[i + mid - 1] - hsh[i - 1] * Pow[mid] % mod + mod) % mod ==
            hsh2[mid])
          ans = mid, l = mid + 1;
        else
          r = mid - 1;
      }
      if (ans == n2)
        dp[i] = (dp[i] + sum[i + n2]) % p;
      else
        dp[i] = (dp[i] + sum[i + n2 + (s1[i + ans] < s2[ans + 1])]) % p;
      if (n - i + 1 >= n3) {
        l = 1, r = n3, ans = 0;
        while (l <= r) {
          mid = (l + r) >> 1;
          if ((hsh[i + mid - 1] - hsh[i - 1] * Pow[mid] % mod + mod) % mod ==
              hsh3[mid])
            ans = mid, l = mid + 1;
          else
            r = mid - 1;
        }
        if (ans == n3)
          dp[i] = (dp[i] - sum[i + n3 + 1]) % p;
        else
          dp[i] = (dp[i] - sum[i + n3 + (s1[i + ans] <= s3[ans + 1])]) % p;
      }
    }
    sum[i] = (sum[i] + dp[i]) % p;
  }
  printf("%lld\n", (dp[1] + p) % p);
  return 0;
}
