func_code_string: #include <bits/stdc++.h>   using namespace std;   inline int in() {     int32_t x;     scanf( %d , &x);     return x;   }   inline long long lin() {     long long x;     scanf( %lld , &x);     return x;   }   inline string get() {     char ch[2000010];     scanf( %s , ch);     return ch;   }   const int MAX_LG = 21;   const int maxn = 18e5 + 10;   const int maxm = 1e5 + 10;   const int base = 29;   const int mod = 1e9 + 7;   const int base2 = 31;   const int mod2 = 1e9 + 9;   const int INF = 2e18 + 100;   const int SQ = 317;   struct state {     int len = 0, link = -1;     int nxt[29];     state() { memset(nxt, 0, sizeof nxt); }   } st[maxn];   int sz = 1;   int last;   inline void add_letter(int c) {     int p = last;     last = sz++;     st[last].len = st[p].len + 1;     for (; p != -1 && st[p].nxt[c] == 0; p = st[p].link) {       st[p].nxt[c] = last;     }     if (p == -1) {       st[last].link = 0;       return;     }     int q = st[p].nxt[c];     if (st[q].len == st[p].len + 1) {       st[last].link = q;       return;     }     int cl = sz++;     for (int i = 0; i < 29; i++) st[cl].nxt[i] = st[q].nxt[i];     st[cl].link = st[q].link;     st[q].link = st[last].link = cl;     st[cl].len = st[p].len + 1;     for (; p != -1 && st[p].nxt[c] == q; p = st[p].link) st[p].nxt[c] = cl;   }   int lim;   int res[maxn];   int fi[maxn], se[maxn], th[maxn];   bool mark[maxn];   inline void dfs(int state) {     if (mark[state]) return;     mark[state] = true;     for (int i = 0; i < 29; i++) {       if (st[state].nxt[i] == 0) continue;       pair<int, int> c = {i, st[state].nxt[i]};       dfs(c.second);       if (c.first == 26)         fi[state]++;       else if (c.first == 27)         se[state]++;       else if (c.first == 28)         th[state]++;       else {         fi[state] += fi[c.second];         se[state] += se[c.second];         th[state] += th[c.second];       }     }   }   inline void calc() {     for (int i = 0; i < sz; i++) {       if (st[i].len == 0 || st[i].len > lim) continue;       res[st[i].len] =           (res[st[i].len] + 1LL * fi[i] * se[i] % mod * th[i] % mod) % mod;       if (st[i].link == 0) continue;       res[st[st[i].link].len] = (res[st[st[i].link].len] -                                  1LL * fi[i] * se[i] % mod * th[i] % mod + mod) %                                 mod;     }   }   int32_t main() {     st[0].link = -1;     string a = get(), b = get(), c = get();     string s = a +  !  + b +  @  + c +  # ;     for (auto ch : s) {       if (ch ==  ! )         add_letter(26);       else if (ch ==  @ )         add_letter(27);       else if (ch ==  # )         add_letter(28);       else         add_letter(ch -  a );     }     lim = (int)min(a.size(), min(b.size(), c.size()));     dfs(0);     calc();     for (int i = lim - 1; i >= 1; i--) {       res[i] += res[i + 1];       if (res[i] >= mod) res[i] -= mod;     }     for (int i = 1; i <= lim; i++) cout << res[i] <<    ;   }   