#include <bits/stdc++.h>
using namespace std;
string s, sl, sr;
int N, NN, Nl, Nr;
unsigned long long h[3][1000005], h1[3][1000005];
unsigned long long Bpw[1000005];
long long Bpw1[1000005];
int Base = 233;
unsigned long long hashLR0(int l, int r, int id) {
  return h[id][r] - Bpw[r - l + 1] * h[id][l - 1];
}
long long hashLR1(int l, int r, int id) {
  return (h1[id][r] - Bpw1[r - l + 1] * h1[id][l - 1] % int(998244353) +
          int(998244353)) %
         int(998244353);
}
long long dp[1000005];
void init() {
  NN = 1e6;
  Bpw[0] = Bpw1[0] = 1;
  for (int i = 1; i <= NN; i++) {
    Bpw[i] = Bpw[i - 1] * Base;
    Bpw1[i] = Bpw1[i - 1] * Base % int(998244353);
  }
  cin >> s >> sl >> sr;
  N = s.length();
  Nl = sl.length();
  Nr = sr.length();
  s = "$" + s;
  sl = "#" + sl;
  sr = "&" + sr;
  for (int i = 1; i <= N; i++) {
    h[0][i] = h[0][i - 1] * Base + s[i];
    h1[0][i] = (h1[0][i - 1] * Base % int(998244353) + s[i]) % int(998244353);
  }
  for (int i = 1; i <= Nl; i++) {
    h[1][i] = h[1][i - 1] * Base + sl[i];
    h1[1][i] = (h1[1][i - 1] * Base % int(998244353) + sl[i]) % int(998244353);
  }
  for (int i = 1; i <= Nr; i++) {
    h[2][i] = h[2][i - 1] * Base + sr[i];
    h1[2][i] = (h1[2][i - 1] * Base % int(998244353) + sr[i]) % int(998244353);
  }
}
bool chk(int l, int r, int id) {
  int i0 = l, mid, len;
  len = r - l + 1;
  if (hashLR0(l, r, 0) == hashLR0(1, len, id) &&
      hashLR1(l, r, 0) == hashLR1(1, len, id))
    return 1;
  while (l < r) {
    mid = (l + r) / 2;
    len = mid - i0 + 1;
    if (hashLR0(i0, mid, 0) != hashLR0(1, len, id) ||
        hashLR1(i0, mid, 0) != hashLR1(1, len, id))
      r = mid;
    else
      l = mid + 1;
  }
  if (id == 1) return s[r] >= sl[r - i0 + 1];
  if (id == 2) return s[r] <= sr[r - i0 + 1];
}
void printFW() {
  cout << "debug" << endl;
  for (int i = 1; i <= N; i++) cout << dp[i] << " ";
  cout << endl;
}
int main() {
  init();
  int l, r, dx;
  long long f0 = 0;
  if (Nl == 1 && sl[1] == '0') f0 = 1;
  dp[0] = 1;
  dp[1] = -1;
  for (int i = 1; i <= N; i++) {
    dp[i] = (dp[i] + dp[i - 1]) % int(998244353);
    if (s[i] == '0') {
      if (!f0) continue;
      dx = dp[i - 1];
      dp[i] = (dp[i] + dx) % int(998244353);
      dp[i + 1] = (dp[i + 1] + int(998244353) - dx) % int(998244353);
      continue;
    }
    l = min(N, i + Nl - 1);
    if (l - i + 1 == Nl && !chk(i, l, 1)) l++;
    r = min(N, i + Nr - 1);
    if (r - i + 1 == Nr && !chk(i, r, 2)) r--;
    dx = dp[i - 1];
    if (l - i + 1 >= Nl && l <= r) {
      dp[l] = (dp[l] + dx) % int(998244353);
      dp[r + 1] = (dp[r + 1] + int(998244353) - dx) % int(998244353);
    }
  }
  cout << dp[N];
  return 0;
}
