#include <bits/stdc++.h>
using namespace std;
namespace yspm {
inline long long read() {
  long long res = 0, f = 1;
  char k;
  while (!isdigit(k = getchar()))
    if (k == '-') f = -1;
  while (isdigit(k)) res = res * 10 + k - '0', k = getchar();
  return res * f;
}
const long long N = 6e5 + 10, mod = 1e9 + 7;
inline long long add(long long x, long long y) {
  return x + y >= mod ? x + y - mod : x + y;
}
inline long long del(long long x, long long y) {
  return x - y < 0 ? x - y + mod : x - y;
}
inline long long mul(long long x, long long y) {
  return x * y - x * y / mod * mod;
}
long long son[N][26], fa[N], sz[N][4], tot = 1, las = 1, len[N], al = 1e18 + 10;
inline long long extend(long long x, long long id) {
  if (son[las][x]) {
    long long q = son[las][x];
    if (len[q] == len[las] + 1) return sz[q][id]++, q;
    long long clone = ++tot;
    fa[clone] = fa[q];
    len[clone] = len[las] + 1;
    sz[clone][id]++;
    fa[q] = clone;
    while (son[las][x] == q) son[las][x] = clone, las = fa[las];
    for (register long long i = 0; i < 26; ++i) son[clone][i] = son[q][i];
    return clone;
  }
  long long tmp = las, np = las = ++tot;
  sz[np][id]++;
  len[np] = len[tmp] + 1;
  while (tmp && !son[tmp][x]) son[tmp][x] = np, tmp = fa[tmp];
  if (!tmp) return fa[np] = 1, np;
  long long q = son[tmp][x];
  if (len[q] == len[tmp] + 1) return fa[np] = q, np;
  long long clone = ++tot;
  len[clone] = len[tmp] + 1;
  fa[clone] = fa[q];
  fa[q] = fa[np] = clone;
  for (register long long i = 0; i < 26; ++i) son[clone][i] = son[q][i];
  while (son[tmp][x] == q) son[tmp][x] = clone, tmp = fa[tmp];
  return np;
}
long long ans[N], head[N], cnt, slen;
struct edge {
  long long to, nxt;
} e[N << 1];
char s[N];
inline void adde(long long u, long long v) {
  e[++cnt].to = v;
  e[cnt].nxt = head[u];
  return head[u] = cnt, void();
}
inline void dfs(long long x) {
  for (register long long i = head[x]; i; i = e[i].nxt) {
    long long t = e[i].to;
    dfs(t);
    sz[x][1] += sz[t][1];
    sz[x][2] += sz[t][2];
    sz[x][3] += sz[t][3];
  }
  long long res = mul(sz[x][1], mul(sz[x][2], sz[x][3]));
  ans[len[fa[x]] + 1] = add(ans[len[fa[x]] + 1], res);
  ans[len[x] + 1] = del(ans[len[x] + 1], res);
  return;
}
signed main() {
  for (register long long i = 1; i <= 3; ++i) {
    scanf("%s", s + 1);
    al = min(al, slen = strlen(s + 1));
    las = 1;
    for (register long long j = 1; j <= slen; ++j) las = extend(s[j] - 'a', i);
  }
  for (register long long i = 2; i <= tot; ++i) adde(fa[i], i);
  dfs(1);
  for (register long long i = 1; i <= al; ++i) ans[i] = add(ans[i], ans[i - 1]);
  for (register long long i = 1; i <= al; ++i) printf("%lld ", ans[i]);
  puts("");
  return 0;
}
}  // namespace yspm
signed main() { return yspm::main(); }
