#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -f;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + (s - '0');
    s = getchar();
  }
  return x * f;
}
const int MOD = 1000000007;
int n, m, i, j, s, o, k;
int nx[300005], tl[300005], rt[300005], pr[300005 << 1];
int ins(int i, int x, int y) { return x == 0 ? (rt[i] = y) : (nx[x] = y); }
void INIT_SUFFIX_ARRAY(char *s, int *sa, int *rk, int n) {
  for (int i = 1; i <= n; i++)
    nx[i] = sa[i] = rk[i] = rt[i] = tl[i] = pr[n + i] = 0;
  for (int i = 1; i <= n; i++)
    nx[tl[0 + s[i]] = ins(0 + s[i], tl[0 + s[i]], i)] = 0;
  int cn = 0;
  for (int i = 0; i < 256; i++) {
    int p = rt[i];
    while (p) {
      sa[++cn] = p;
      if (p == tl[i]) break;
      p = nx[p];
    }
    rt[i] = tl[i] = 0;
  }
  rk[sa[1]] = 1;
  for (int i = 2; i <= n; i++)
    rk[sa[i]] = (s[sa[i - 1]] == s[sa[i]] ? rk[sa[i - 1]] : rk[sa[i - 1]] + 1);
  for (int ii = 1; ii < n; ii <<= 1) {
    for (int i = n + 1 - ii; i <= n; i++)
      nx[tl[rk[i]] = ins(rk[i], tl[rk[i]], i)] = 0;
    for (int i = 1; i <= n; i++) {
      int y = sa[i] - ii;
      if (y < 1) continue;
      nx[tl[rk[y]] = ins(rk[y], tl[rk[y]], y)] = 0;
    }
    cn = 0;
    int nm = 0;
    for (int i = 1; i <= n; i++) pr[i] = rk[i], rk[i] = 0;
    for (int i = 1; i <= n; i++) {
      int p = rt[i], pp = 0;
      while (p) {
        sa[++cn] = p;
        rk[p] = (!pp ? (++nm) : (pr[pp + ii] == pr[p + ii] ? nm : ++nm));
        if (p == tl[i]) break;
        pp = p;
        p = nx[p];
      }
      rt[i] = tl[i] = 0;
    }
  }
  return;
}
void INIT_HEIGHT(char *s, int *sa, int *rk, int *hi, int n) {
  hi[0] = 0;
  for (int i = 1; i <= n; i++) {
    int k = sa[rk[i] - 1];
    if (k < 1) {
      hi[i] = 0;
      continue;
    }
    hi[i] = max(0, hi[i - 1] - 1);
    while (s[i + hi[i]] == s[k + hi[i]]) hi[i]++;
  }
  return;
}
struct it {
  int ht, ad;
  it() {
    ht = 0x3f3f3f3f;
    ad = 0;
  }
  it(int H, int A) {
    ht = H;
    ad = A;
  }
} st[300005];
bool cmp(it a, it b) { return a.ht != b.ht ? (a.ht < b.ht) : (a.ad < b.ad); }
it bing(it a, it b) { return it(min(a.ht, b.ht), max(a.ad, b.ad)); }
it tre[300005 << 2];
int M;
void maketree(int n) {
  M = 1;
  while (M < n + 2) M <<= 1;
  for (int i = 1; i <= M * 2 + 1; i++) tre[i] = it();
}
void addtree(int x, it y) {
  int s = M + x;
  tre[s] = y;
  s >>= 1;
  while (s) tre[s] = bing(tre[s << 1], tre[s << 1 | 1]), s >>= 1;
}
it findtree(int l, int r) {
  int s = M + l - 1, t = M + r + 1;
  it as;
  while (s || t) {
    if ((s >> 1) != (t >> 1)) {
      if (!(s & 1)) as = bing(as, tre[s ^ 1]);
      if (t & 1) as = bing(as, tre[t ^ 1]);
    } else
      break;
    s >>= 1;
    t >>= 1;
  }
  return as;
}
int C3(int n) {
  if (n < 3) return 0;
  return (n * 1ll * (n - 1) / 2ll * 1ll * (n - 2) / 3ll) % MOD;
}
int ans[300005];
struct ST {
  char ss[300005];
  int n;
  int rk[300005], sa[300005], ht[300005], h[300005];
  ST() {
    memset((ss), 0, sizeof((ss))), memset((rk), 0, sizeof((rk))),
        memset((sa), 0, sizeof((sa))), memset((ht), 0, sizeof((ht))),
        memset((h), 0, sizeof((h))), n = 0;
  }
  void add(char c) { ss[++n] = c; }
  void INIT() {
    INIT_SUFFIX_ARRAY(ss, sa, rk, n);
    INIT_HEIGHT(ss, sa, rk, ht, n);
    for (int i = 1; i <= n; i++) h[i] = ht[sa[i]];
  }
  void js(int f) {
    for (int i = 1; i <= n; i++) st[i] = it(h[i], i);
    maketree(n + 1);
    addtree(1, it(1, 1));
    addtree(n + 1, it(n + 1, n + 1));
    sort(st + 1, st + 1 + n, cmp);
    int j = 2, as = C3(n);
    for (int i = 1; i <= n; i++) {
      while (j <= n && st[j].ht < i) {
        int t = st[j].ad;
        it ll = findtree(1, t);
        it rr = findtree(t, n + 1);
        as = (0ll + as + MOD - C3(rr.ht - ll.ad)) % MOD;
        (as += C3(t - ll.ad)) %= MOD;
        (as += C3(rr.ht - t)) %= MOD;
        addtree(t, it(t, t));
        j++;
      }
      (ans[i] += (0ll + MOD + as * f) % MOD) %= MOD;
    }
    return;
  }
};
ST Sa, Sb, Sc, Sab, Sbc, Sac, Sabc;
char A[300005], B[300005], C[300005];
int main() {
  int na, nb, nc;
  scanf("%s", A + 1);
  na = strlen(A + 1);
  scanf("%s", B + 1);
  nb = strlen(B + 1);
  scanf("%s", C + 1);
  nc = strlen(C + 1);
  A[++na] = '#';
  B[++nb] = '*';
  C[++nc] = '$';
  for (int i = 1; i <= na; i++) {
    Sa.add(A[i]);
    Sab.add(A[i]);
    Sac.add(A[i]);
    Sabc.add(A[i]);
  }
  for (int i = 1; i <= nb; i++) {
    Sb.add(B[i]);
    Sab.add(B[i]);
    Sbc.add(B[i]);
    Sabc.add(B[i]);
  }
  for (int i = 1; i <= nc; i++) {
    Sc.add(C[i]);
    Sbc.add(C[i]);
    Sac.add(C[i]);
    Sabc.add(C[i]);
  }
  Sa.INIT();
  Sb.INIT();
  Sc.INIT();
  Sab.INIT();
  Sbc.INIT();
  Sac.INIT();
  Sabc.INIT();
  Sabc.js(1);
  Sab.js(-1);
  Sbc.js(-1);
  Sac.js(-1);
  Sa.js(1);
  Sb.js(1);
  Sc.js(1);
  for (int i = 1; i <= min(na, min(nb, nc)) - 1; i++) {
    printf("%d ", ans[i]);
  }
  putchar('\n');
  return 0;
}
