#include <bits/stdc++.h>
using namespace std;
const int maxn = 600050;
const int INF = 1e9;
const long long MOD = 1e9 + 7;
long long res[maxn];
int ch[maxn][26];
int sz[3][maxn];
int len[maxn], fa[maxn];
int sum[maxn];
char s[maxn];
int last, tot;
void init() { tot = 1; }
void build_sam(char *s, int len_s, int f) {
  last = 1;
  for (int i = 0; i < len_s; i++) {
    int id = s[i] - 'a';
    int p = last;
    if (ch[p][id] && len[ch[p][id]] == len[p] + 1) {
      last = ch[p][id];
      sz[f][last] = 1;
      continue;
    }
    int np = ++tot;
    last = np;
    len[np] = len[p] + 1;
    while (p && !ch[p][id]) {
      ch[p][id] = np;
      p = fa[p];
    }
    if (!p)
      fa[np] = 1;
    else {
      int q = ch[p][id];
      if (len[q] == len[p] + 1)
        fa[np] = q;
      else {
        int nq = ++tot;
        if (len[np] == len[p] + 1) last = nq;
        for (int i = 0; i < 26; i++) ch[nq][i] = ch[q][i];
        fa[nq] = fa[q];
        fa[q] = fa[np] = nq;
        len[nq] = len[p] + 1;
        while (p && ch[p][id] == q) {
          ch[p][id] = nq;
          p = fa[p];
        }
      }
    }
    sz[f][last] = 1;
  }
}
void solve() {
  init();
  int min_len = INF;
  for (int i = 0; i < 3; i++) {
    scanf("%s", s);
    int len_s = strlen(s);
    min_len = min(min_len, len_s);
    build_sam(s, len_s, i);
  }
  queue<int> q;
  for (int i = 2; i <= tot; i++) sum[fa[i]]++;
  for (int i = 1; i <= tot; i++) {
    if (!sum[i]) q.push(i);
  }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < 3; i++) sz[i][fa[u]] += sz[i][u];
    sum[fa[u]]--;
    if (!sum[fa[u]]) q.push(fa[u]);
  }
  for (int i = 2; i <= tot; i++) {
    long long tmp = (long long)sz[0][i] * sz[1][i] % MOD * sz[2][i] % MOD;
    res[len[fa[i]] + 1] += tmp;
    res[len[i] + 1] -= tmp;
  }
  long long ans = 0;
  for (int i = 1; i <= min_len; i++) {
    ans = ans + res[i];
    printf("%lld ", ans % MOD);
  }
  printf("\n");
}
int main() {
  solve();
  return 0;
}
