#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m, k, link[600005], len[600005], ch[600005][26], siz[600005][3],
    last = 1, cnt = 1, ans = 0x3f3f3f3f, sum[300005];
char s[300005], ss[300005], sss[300005];
vector<long long> g[600005];
void insert(long long x, long long type) {
  long long p = last, cur = ++cnt;
  last = cur;
  len[cur] = len[p] + 1;
  siz[cur][type] = 1;
  while (p && !ch[p][x]) ch[p][x] = cur, p = link[p];
  if (!p) {
    link[cur] = 1;
    return;
  }
  long long q = ch[p][x];
  if (len[q] == len[p] + 1) {
    link[cur] = q;
    return;
  }
  long long clone = ++cnt;
  len[clone] = len[p] + 1;
  memcpy(ch[clone], ch[q], sizeof(ch[clone]));
  link[clone] = link[q], link[q] = link[cur] = clone;
  while (p && ch[p][x] == q) ch[p][x] = clone, p = link[p];
}
void dfs(long long x) {
  for (long long to : g[x])
    dfs(to), siz[x][0] += siz[to][0], siz[x][1] += siz[to][1],
        siz[x][2] += siz[to][2];
  sum[len[link[x]] + 1] =
      (sum[len[link[x]] + 1] + siz[x][0] * siz[x][1] % mod * siz[x][2] % mod) %
      mod;
  sum[len[x] + 1] =
      (sum[len[x] + 1] - siz[x][0] * siz[x][1] % mod * siz[x][2] % mod) % mod;
}
signed main() {
  scanf("%s%s%s", s + 1, ss + 1, sss + 1);
  n = strlen(s + 1), m = strlen(ss + 1), k = strlen(sss + 1);
  for (long long i = 1; i <= n; i++) insert(s[i] - 'a', 0);
  last = 1;
  for (long long i = 1; i <= m; i++) insert(ss[i] - 'a', 1);
  last = 1;
  for (long long i = 1; i <= k; i++) insert(sss[i] - 'a', 2);
  for (long long i = cnt; i > 1; i--) g[link[i]].push_back(i);
  dfs(1);
  for (long long i = 1; i <= min(min(n, m), k); i++) {
    sum[i] = (sum[i - 1] + sum[i]) % mod;
    printf("%lld ", (sum[i] % mod + mod) % mod);
  }
  return 0;
}
