#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T& x) {
  T res = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    res = (res << 3) + (res << 1) + c - '0';
    c = getchar();
  }
  x = res * f;
}
const long long N = 600000 + 10;
const long long mod = 1e9 + 7;
struct node {
  long long nxt[26], fa, len;
} nod[N];
long long tot = 1, siz[N][3];
long long ext(long long w, long long last) {
  long long p = last;
  if (nod[p].nxt[w]) {
    long long q = nod[last].nxt[w];
    if (nod[q].len == nod[p].len + 1)
      return q;
    else {
      long long nq = ++tot;
      nod[nq] = nod[q];
      nod[nq].len = nod[p].len + 1;
      nod[q].fa = nq;
      for (; p && nod[p].nxt[w] == q; p = nod[p].fa) nod[p].nxt[w] = nq;
      return nq;
    }
  }
  long long now = ++tot;
  nod[now].len = nod[p].len + 1;
  for (; p && !nod[p].nxt[w]; p = nod[p].fa) nod[p].nxt[w] = now;
  if (!p)
    nod[now].fa = 1;
  else {
    long long q = nod[p].nxt[w];
    if (nod[q].len == nod[p].len + 1)
      nod[now].fa = q;
    else {
      long long nq = ++tot;
      nod[nq] = nod[q];
      nod[nq].len = nod[p].len + 1;
      nod[q].fa = nod[now].fa = nq;
      for (; p && nod[p].nxt[w] == q; p = nod[p].fa) nod[p].nxt[w] = nq;
    }
  }
  return now;
}
vector<long long> p[N];
char s[N];
long long ans[N];
void dfs(long long u) {
  for (auto to : p[u]) {
    dfs(to);
    for (long long i = 0; i <= 2; i++) siz[u][i] += siz[to][i];
  }
}
signed main() {
  long long mn = 1e9;
  for (long long i = 0; i <= 2; i++) {
    scanf("%s", s + 1);
    long long n = strlen(s + 1);
    mn = min(n, mn);
    for (long long j = 1, last = 1; j <= n; j++)
      last = ext(s[j] - 'a', last), siz[last][i]++;
  }
  for (long long i = 2; i <= tot; i++) p[nod[i].fa].push_back(i);
  dfs(1);
  for (long long i = 1; i <= tot; i++) {
    long long base = 1ll * siz[i][2] * siz[i][1] % mod * siz[i][0] % mod;
    ans[nod[i].len + 1] = (ans[nod[i].len + 1] - base) % mod;
    ans[nod[nod[i].fa].len + 1] = (ans[nod[nod[i].fa].len + 1] + base) % mod;
  }
  for (long long i = 1; i <= mn; i++)
    (ans[i] = ans[i] + ans[i - 1]) % mod,
        printf("%lld ", (ans[i] % mod + mod) % mod);
  return 0;
}
