#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 3000005;
char A[N], B[N], C[N], S[N];
int la, lb, lc, ls;
struct suffix_array {
  int sa[N], rk[N], hr[N], hs[N];
  int sz, tmp[N], bin[N];
  void build(char *S, int ls) {
    sz = max(255, ls);
    for (int i = (1); i <= (ls); ++i) rk[i] = S[i];
    for (int i = (1); i <= (sz); ++i) bin[i] = 0;
    for (int i = (1); i <= (ls); ++i) bin[rk[i]]++;
    for (int i = (1); i <= (sz); ++i) bin[i] += bin[i - 1];
    for (int i = (1); i <= (ls); ++i) sa[bin[rk[i]]--] = i;
    for (int j = 1; j <= ls; j <<= 1) {
      int tot = 0;
      for (int i = (ls - j + 1); i <= (ls); ++i) tmp[++tot] = i;
      for (int i = (1); i <= (ls); ++i)
        if (sa[i] - j > 0) tmp[++tot] = sa[i] - j;
      for (int i = (1); i <= (sz); ++i) bin[i] = 0;
      for (int i = (1); i <= (ls); ++i) bin[rk[i]]++;
      for (int i = (1); i <= (sz); ++i) bin[i] += bin[i - 1];
      for (int i = (ls); i >= (1); --i) sa[bin[rk[tmp[i]]]--] = tmp[i];
      tot = 1;
      tmp[sa[1]] = 1;
      for (int i = (2); i <= (ls); ++i)
        tmp[sa[i]] =
            rk[sa[i]] == rk[sa[i - 1]] && rk[sa[i] + j] == rk[sa[i - 1] + j]
                ? tot
                : ++tot;
      for (int i = (1); i <= (ls); ++i) rk[i] = tmp[i];
      if (tot == ls) break;
    }
    for (int i = (1); i <= (ls); ++i) {
      hs[i] = max(0, hs[i - 1] - 1);
      while (S[i + hs[i]] == S[sa[rk[i] - 1] + hs[i]]) hs[i]++;
      hr[rk[i]] = hs[i];
    }
  }
} SA;
struct node {
  int x, y, z;
} s[N];
bool operator<(const node &a, const node &b) { return a.z < b.z; }
long long ans[N];
struct bcj {
  int fa[N], a[N], b[N], c[N], len[N];
  void init(int ls) {
    for (int i = (1); i <= (ls); ++i) {
      fa[i] = i;
      len[i] = ls;
      if (i <= la) a[i]++;
      if (i >= la + 1 + 1 && i <= la + 1 + lb) b[i]++;
      if (i >= la + 1 + lb + 1 + 1) c[i]++;
    }
  }
  int get(int x) {
    if (x == fa[x]) return x;
    return fa[x] = get(fa[x]);
  }
  void merge(int x, int y, int z) {
    int f1 = get(x);
    int f2 = get(y);
    ans[z] = (0ll + ans[z] + (1ll * a[f2] * b[f1] % mod * c[f1] % mod) +
              (1ll * a[f2] * b[f2] % mod * c[f1] % mod) +
              (1ll * a[f2] * b[f1] % mod * c[f2] % mod) +
              (1ll * a[f1] * b[f2] % mod * c[f2] % mod) +
              (1ll * a[f1] * b[f2] % mod * c[f1] % mod) +
              (1ll * a[f1] % mod * b[f1] * c[f2] % mod)) %
             mod;
    len[f2] = z;
    a[f2] += a[f1];
    b[f2] += b[f1];
    c[f2] += c[f1];
    fa[f1] = f2;
  }
} DSU;
int main() {
  scanf("%s", A + 1);
  la = strlen(A + 1);
  scanf("%s", B + 1);
  lb = strlen(B + 1);
  scanf("%s", C + 1);
  lc = strlen(C + 1);
  memcpy(S + 1, A + 1, la);
  S[la + 1] = 'z' + 1;
  memcpy(S + 1 + la + 1, B + 1, lb);
  S[la + 1 + lb + 1] = 'z' + 2;
  memcpy(S + 1 + la + 1 + lb + 1, C + 1, lc);
  ls = strlen(S + 1);
  SA.build(S, ls);
  int x = min(min(la, lb), lc);
  DSU.init(ls);
  int tot = 0;
  for (int i = (2); i <= (ls); ++i)
    s[++tot].x = SA.sa[i - 1], s[tot].y = SA.sa[i], s[tot].z = SA.hr[i];
  sort(s + 1, s + 1 + tot);
  reverse(s + 1, s + 1 + tot);
  for (int i = (1); i <= (tot); ++i) DSU.merge(s[i].x, s[i].y, s[i].z);
  for (int i = (x - 1); i >= (1); --i) ans[i] = (ans[i] + ans[i + 1]) % mod;
  for (int i = (1); i <= (x); ++i) printf("%d ", ans[i]);
}
