func_code_string: #include <bits/stdc++.h>   int inp() {     char c = getchar();     while (c <  0  || c >  9 ) c = getchar();     int sum = 0;     while (c >=  0  && c <=  9 ) {       sum = sum * 10 + c -  0 ;       c = getchar();     }     return sum;   }   char s[1000010], l[1000010], r[1000010];   long long f[1000010], sum[1000010];   int n, sl, sr, pl[1000010], pr[1000010], hshs[1000010], hshl[1000010],       hshr[1000010], fpow[1000010];   bool ok1(int x) {     if (x + sl - 1 > n) return false;     if (sl == pl[x]) return true;     return l[pl[x] + 1] < s[x + pl[x]];   }   bool ok2(int x) {     if (x + sr - 1 > n) return false;     if (pr[x] == sr) return true;     return r[pr[x] + 1] > s[x + pr[x]];   }   int get_hsh(int *hsh, int l, int r) {     return (hsh[r] -             ((long long)(hsh[l - 1]) * (long long)(fpow[r - l + 1]) % 998244353) +             998244353) %            998244353;   }   void solve(int *s, int *hsh, int len) {     for (int i = 1; i <= n - len + 1; i++) {       int l = 0;       int r = len;       while (l < r) {         int mid = (l + r + 1) >> 1;         if (get_hsh(hshs, i, i + mid - 1) == get_hsh(hsh, 1, mid))           l = mid;         else           r = mid - 1;       }       s[i] = l;     }   }   void gethash(char *str, int *hsh, int len) {     for (int i = 1; i <= len; i++)       hsh[i] = ((long long)(hsh[i - 1]) * (long long)(11) + str[i] -  0  + 1) %                998244353;   }   int main() {     fpow[0] = 1;     for (int i = 1; i <= 1000000; i++)       fpow[i] = ((long long)(fpow[i - 1]) * (long long)(11) % 998244353);     scanf( %s , s + 1);     scanf( %s , l + 1);     scanf( %s , r + 1);     n = strlen(s + 1);     sl = strlen(l + 1);     sr = strlen(r + 1);     gethash(l, hshl, sl);     gethash(r, hshr, sr);     gethash(s, hshs, n);     f[0] = 1;     solve(pl, hshl, sl);     solve(pr, hshr, sr);     for (int i = 0; i <= n; i++) {       if (i) {         sum[i] += sum[i - 1];         f[i] += sum[i];         f[i] %= 998244353;       }       if (s[i + 1] ==  0 ) {         if (sl == 1 && l[1] ==  0 ) {           f[i + 1] += f[i];           f[i + 1] %= 998244353;         }         continue;       }       if (sl < sr) {         sum[sl + i + 1] += f[i];         sum[sl + i + 1] %= 998244353;         sum[sr + i] += 998244353 - f[i];         sum[sr + i] %= 998244353;       }       if (sl == sr) {         if (ok1(i + 1) && ok2(i + 1)) {           f[i + sl] += f[i];           f[i + sl] %= 998244353;         }       } else {         if (ok1(i + 1)) {           f[i + sl] += f[i];           f[i + sl] %= 998244353;         }         if (ok2(i + 1)) {           f[i + sr] += f[i];           f[i + sr] %= 998244353;         }       }     }     std::cout << f[n] << std::endl;   }   