func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1000010;   const int mod = 998244353;   char str[N];   char s[2][N];   int nxt[2][N];   int extend[2][N];   void get_nxt(char *s, int *nxt) {     int n = strlen(s), r = 0, pos = 1;     nxt[0] = n;     while (r + 1 < n && s[r] == s[r + 1]) ++r;     nxt[1] = r;     for (int i = 2; i < n; ++i) {       nxt[i] = max(0, min(nxt[i - pos], r - i + 1));       while (i + nxt[i] < n && s[i + nxt[i]] == s[nxt[i]]) ++nxt[i];       if (i + nxt[i] - 1 > r) {         r = i + nxt[i] - 1;         pos = i;       }     }   }   void get_extend(char *s, char *t, int *nxt, int *extend) {     int n = strlen(s), m = strlen(t), pos = 0, r;     while (s[extend[0]] == t[extend[0]]) ++extend[0];     r = extend[0] - 1;     for (int i = 1; i < n; ++i) {       extend[i] = max(0, min(nxt[i - pos], r - i + 1));       while (i + extend[i] < n && extend[i] < m &&              s[i + extend[i]] == t[extend[i]])         ++extend[i];       if (i + extend[i] - 1 > r) {         r = i + extend[i] - 1;         pos = i;       }     }   }   int a[N << 2];   int tag[N << 2];   void pushdown(int x) {     a[(x << 1)] = (a[(x << 1)] + tag[x]) % mod;     tag[(x << 1)] = (tag[(x << 1)] + tag[x]) % mod;     a[(x << 1 | 1)] = (a[(x << 1 | 1)] + tag[x]) % mod;     tag[(x << 1 | 1)] = (tag[(x << 1 | 1)] + tag[x]) % mod;     tag[x] = 0;   }   void add(int x, int l, int r, int ll, int rr, int p) {     if (ll > rr) return;     if (l >= ll && r <= rr) {       a[x] = (a[x] + p) % mod;       tag[x] = (tag[x] + p) % mod;     } else {       if (tag[x]) pushdown(x);       if (((l + r) >> 1) >= ll) add((x << 1), l, ((l + r) >> 1), ll, rr, p);       if (((l + r) >> 1) < rr)         add((x << 1 | 1), ((l + r) >> 1) + 1, r, ll, rr, p);     }   }   int query(int x, int l, int r, int pos) {     if (pos == -1) return 1;     if (l == r)       return a[x];     else {       if (tag[x]) pushdown(x);       if (pos <= ((l + r) >> 1))         return query((x << 1), l, ((l + r) >> 1), pos);       else         return query((x << 1 | 1), ((l + r) >> 1) + 1, r, pos);     }   }   int sum[N];   int now;   int main() {     scanf( %s %s %s , str, s[0], s[1]);     int len = strlen(str);     int lenl = strlen(s[0]);     int lenr = strlen(s[1]);     int f = (lenl == 1 && s[0][0] ==  0 );     get_nxt(s[0], nxt[0]);     get_nxt(s[1], nxt[1]);     get_extend(str, s[0], nxt[0], extend[0]);     get_extend(str, s[1], nxt[1], extend[1]);     int now = 1;     sum[0] = mod - 1;     for (int i = 0; i < len; ++i) {       int l, r;       if (str[i] ==  0 ) {         if (f)           l = r = i;         else {           now = (now + sum[i]) % mod;           continue;         }       } else {         l = i + lenl - 1;         if (extend[0][i] != lenl && s[0][extend[0][i]] > str[i + extend[0][i]])           ++l;         r = i + lenr - 1;         if (extend[1][i] != lenr && (s[1][extend[1][i]] < str[i + extend[1][i]]))           --r;       }       sum[l] = (sum[l] + now) % mod;       sum[r + 1] = (sum[r + 1] - now + mod) % mod;       now = (now + sum[i]) % mod;     }     printf( %d n , now);     return 0;   }   