func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /stack:32000000 )   using namespace std;   const int INF = 2147483647;   const long long LLINF = 9223372036854775807LL;   const int maxn = 300100;   struct state {     int len, link;     map<char, int> next;     int cnt[3];     state() { memset(cnt, 0, sizeof(cnt)); }   };   const int MAXLEN = 300100;   state st[MAXLEN * 2];   int sz, last;   void sa_init() {     sz = last = 0;     st[0].len = 0;     st[0].link = -1;     ++sz;   }   int KK;   vector<int> states[maxn];   void sa_extend(char c) {     int cur = sz++;     st[cur].len = st[last].len + 1;     if (c >=  a  && c <=  z ) st[cur].cnt[KK] = 1;     int p;     for (p = last; p != -1 && !st[p].next.count(c); p = st[p].link)       st[p].next[c] = cur;     if (p == -1)       st[cur].link = 0;     else {       int q = st[p].next[c];       if (st[p].len + 1 == st[q].len)         st[cur].link = q;       else {         int clone = sz++;         st[clone].len = st[p].len + 1;         st[clone].next = st[q].next;         st[clone].link = st[q].link;         for (; p != -1 && st[p].next[c] == q; p = st[p].link)           st[p].next[c] = clone;         st[q].link = st[cur].link = clone;       }     }     last = cur;   }   const int mod = 1000000007;   struct num {     int x;     num() : x(0) {}     num(int x) : x(x) {}     num operator+(const num& o) const {       num res(x + o.x);       if (res.x >= mod) res.x -= mod;       return res;     }     num operator-(const num& o) const {       num res(x - o.x);       if (res.x < 0) res.x += mod;       return res;     }     num operator*(const num& o) const { return num(x * (long long)o.x % mod); }   };   num add[maxn];   num ans[maxn];   int main() {     string s1, s2, s3;     cin >> s1 >> s2 >> s3;     sa_init();     KK = 0;     for (int i = 0; i < int((s1).size()); ++i) sa_extend(s1[i]);     sa_extend( A );     KK = 1;     for (int i = 0; i < int((s2).size()); ++i) sa_extend(s2[i]);     sa_extend( B );     KK = 2;     for (int i = 0; i < int((s3).size()); ++i) sa_extend(s3[i]);     sa_extend( C );     for (int i = 0; i < sz; ++i) states[st[i].len].push_back(i);     for (int ii = maxn - 1; ii >= 1; --ii) {       for (int i = 0; i < int((states[ii]).size()); ++i) {         int curst = states[ii][i];         for (int iter = 0; iter < 3; ++iter)           st[st[curst].link].cnt[iter] += st[curst].cnt[iter];       }     }     for (int i = 1; i < sz; ++i) {       num curres = num(st[i].cnt[0]) * num(st[i].cnt[1]) * num(st[i].cnt[2]);       add[st[i].len] = add[st[i].len] + curres;       int lf = st[st[i].link].len;       add[lf] = add[lf] - curres;     }     num cr(0);     for (int i = maxn - 1; i >= 0; --i) {       cr = cr + add[i];       ans[i] = cr;     }     int to = min(int((s1).size()), min(int((s2).size()), int((s3).size())));     for (int i = 0; i < to; ++i) printf( %d  , ans[i + 1].x);     return 0;   }   