func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   const int maxn = 611111;   long long num[maxn];   namespace SAM {   int trans[maxn][30], par[maxn], len[maxn], tot, last;   long long cnt[maxn][3];   inline int NewNode() {     memset(trans[tot], 0, sizeof(trans[tot]));     return tot++;   }   inline int NewNode(int u) {     memcpy(trans[tot], trans[u], sizeof(trans[u]));     par[tot] = par[u];     return tot++;   }   inline int h(int u) { return len[u] - len[par[u]]; }   void Extend(int w) {     int p = last, np = NewNode();     len[np] = len[p] + 1;     while (p && !trans[p][w]) {       trans[p][w] = np;       p = par[p];     }     if (!p && !trans[p][w]) {       trans[p][w] = np;       par[np] = 0;     } else {       int q = trans[p][w];       if (len[p] + 1 == len[q])         par[np] = q;       else {         int nq = NewNode(q);         len[nq] = len[p] + 1;         par[q] = par[np] = nq;         while (p && trans[p][w] == q) {           trans[p][w] = nq;           p = par[p];         }         if (!p && trans[p][w] == q) trans[p][w] = nq;       }     }     last = np;   }   bool vis[maxn];   void Dp(int u) {     if (vis[u]) return;     vis[u] = true;     for (int k = 0; k < 3; k++) {       if (trans[u][26 + k]) cnt[u][k] = 1;     }     for (int i = 0; i < 26; i++) {       int v = trans[u][i];       if (v) {         Dp(v);         for (int k = 0; k < 3; k++) {           cnt[u][k] = (cnt[u][k] + cnt[v][k]) % MOD;         }       }     }   }   void Gao() {     for (int i = 1; i < tot; i++) {       long long tmp = ((cnt[i][0] * cnt[i][1]) % MOD * cnt[i][2]) % MOD;       num[len[i]] = (num[len[i]] + tmp) % MOD;       num[len[par[i]]] = (num[len[par[i]]] - tmp + MOD) % MOD;     }     for (int i = tot - 2; i >= 1; i--) {       num[i] = (num[i] + num[i + 1]) % MOD;     }   }   void Init() {     memset(vis, 0, sizeof(vis));     memset(cnt, 0, sizeof(cnt));     tot = 0;     NewNode();   }   void Debug(int tp = 0) {     if (tp == 0)       for (int i = 0; i < tot; i++) {         printf( i=%d,par=%d,len=%d n , i, par[i], len[i]);         for (int j = 0; j < 30; j++) {           if (trans[i][j]) {             printf( to %d %c n , trans[i][j], (char)(j +  a ));           }         }       }     if (tp == 1)       for (int i = 0; i < tot; i++) {         printf( i=%d %I64d %I64d %I64d n , i, cnt[i][0], cnt[i][1], cnt[i][2]);       }   }   }  // namespace SAM   const int INF = 0x3f3f3f3f;   char s[maxn];   int main() {     SAM::Init();     int n = INF;     scanf( %s , s);     n = min(n, (int)strlen(s));     for (int i = 0; s[i]; i++) SAM::Extend(s[i] -  a );     SAM::Extend(26);     scanf( %s , s);     n = min(n, (int)strlen(s));     for (int i = 0; s[i]; i++) SAM::Extend(s[i] -  a );     SAM::Extend(27);     scanf( %s , s);     n = min(n, (int)strlen(s));     for (int i = 0; s[i]; i++) SAM::Extend(s[i] -  a );     SAM::Extend(28);     SAM::Dp(0);     SAM::Gao();     for (int i = 1; i <= n; i++) {       if (i > 1) printf(   );       printf( %I64d , num[i]);     }     puts(  );     return 0;   }   