#include<bits/stdc++.h>
using namespace std;
vector<int> Z(string s) {
int n = s.size();
vector<int> z(n, 0);
for (int i = 1, l = 0, r = 0; i < n; ++i) {
if (i <= r) z[i] = min(r - i + 1, z[i - l]);
while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
if (i + z[i] - 1 > r) r = i + z[i] - 1, l = i;
}
return z;
}
const long long mod = 998244353;
string a, l, r;
bool isaGreaterThan(int l, int r, string &b, vector<int> &zb) {
// return a[l..r] > b
if (r < l) return false;
int len_b = b.size();
if (r - l + 1 < len_b) return false;
if (r - l + 1 > len_b) return true;
int len = zb[len_b + l + 1];
if (len >= len_b) return false;
return a[l + len] > b[len];
}
bool isaEqual(int l, int r, string &b, vector<int> &zb) {
// return a[l..r] == b
if (r < l) return false;
int len_b = b.size();
if (r - l + 1 != len_b) return false;
int len = zb[len_b + l + 1];
return (len >= len_b);
}
void solve() {
cin >> a >> l >> r;
vector<int> zl = Z(l + "#" + a);
vector<int> zr = Z(r + "#" + a);
int n = a.size();
vector<long long> f(n + 5, 0), sum_suffix(n + 5, 0);
f[n] = sum_suffix[n] = 1;
int u = n, v = n - 1;
for (int i = n - 1; i >= 0; --i) {
if (a[i] == '0') {
f[i] = f[i + 1] * (l == "0");
}
else {
while (isaGreaterThan(i, u - 1, l, zl) || isaEqual(i, u - 1, l, zl)) --u;
while (isaGreaterThan(i, v, r, zr)) --v;
f[i] = (sum_suffix[u + 1] - sum_suffix[v + 2] + mod) % mod;
}
sum_suffix[i] = (sum_suffix[i + 1] + f[i]) % mod;
}
cout << f[0];
}
int main() {
solve();
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKCnZlY3RvcjxpbnQ+IFooc3RyaW5nIHMpIHsKICAgIGludCBuID0gcy5zaXplKCk7CiAgICB2ZWN0b3I8aW50PiB6KG4sIDApOwogICAgZm9yIChpbnQgaSA9IDEsIGwgPSAwLCByID0gMDsgaSA8IG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bl9iKTsKfQoKdm9pZCBzb2x2ZSgpIHsKICAgIGNpbiA+PiBhID4+IGwgPj4gcjsKCiAgICB2ZWN0b3I8aW50PiB6bCA9IFoobCArICIjIiArIGEpOwogICAgdmVjdG9yPGludD4genIgPSBaKHIgKyAiIyIgKyBhKTsKCiAgICBpbnQgbiA9IGEuc2l6ZSgpOwogICAgdmVjdG9yPGxvbmcgbG9uZz4gZihuICsgNSwgMCksIHN1bV9zdWZmaXgobiArIDUsIDApOwogICAgZltuXSA9IHN1bV9zdWZmaXhbbl0gPSAxOwogICAgaW50IHUgPSBuLCB2ID0gbiAtIDE7CiAgICBmb3IgKGludCBpID0gbiAtIDE7IGkgPj0gMDsgLS1pKSB7CiAgICAgICAgaWYgKGFbaV0gPT0gJzAnKSB7CiAgICAgICAgICAgIGZbaV0gPSBmW2kgKyAxXSAqIChsID09ICIwIik7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICB3aGlsZSAoaXNhR3JlYXRlclRoYW4oaSwgdSAtIDEsIGwsIHpsKSB8fCBpc2FFcXVhbChpLCB1IC0gMSwgbCwgemwpKSAtLXU7CiAgICAgICAgICAgIHdoaWxlIChpc2FHcmVhdGVyVGhhbihpLCB2LCByLCB6cikpIC0tdjsKICAgICAgICAgICAgZltpXSA9IChzdW1fc3VmZml4W3UgKyAxXSAtIHN1bV9zdWZmaXhbdiArIDJdICsgbW9kKSAlIG1vZDsKICAgICAgICB9CiAgICAgICAgc3VtX3N1ZmZpeFtpXSA9IChzdW1fc3VmZml4W2kgKyAxXSArIGZbaV0pICUgbW9kOwogICAgfQogICAgY291dCA8PCBmWzBdOwp9CgppbnQgbWFpbigpIHsKICAgIHNvbHZlKCk7CiAgICByZXR1cm4gMDsKfQ==