#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, mod = 1000000007;
int tr[N << 2][26], fa[N << 2], len[N << 2], cnt = 1;
long long tot[3][N << 2];
void cpy(int p, int q) {
  for (int i = 0; i < 26; i++) tr[p][i] = tr[q][i];
  fa[p] = fa[q];
}
int extend(int c, int las, int pos) {
  int p = las, nq = tr[p][c], np = ++cnt;
  if (len[nq] == len[p] + 1) {
    tot[pos][nq]++;
    return nq;
  }
  len[np] = len[p] + 1;
  bool flag = 0;
  for (; p && !tr[p][c]; p = fa[p]) tr[p][c] = np;
  if (!p)
    fa[np] = 1;
  else {
    int q = tr[p][c];
    if (len[q] == len[p] + 1)
      fa[np] = q;
    else {
      if (p == las) flag = 1;
      nq = ++cnt;
      cpy(nq, q);
      len[nq] = len[p] + 1;
      fa[np] = fa[q] = nq;
      for (; p && tr[p][c] == q; p = fa[p]) tr[p][c] = nq;
    }
  }
  int ret = flag ? nq : np;
  tot[pos][ret]++;
  return ret;
}
int pai[N << 2], a[N << 2];
void calc() {
  for (int i = 1; i <= cnt; i++) pai[len[i]]++;
  for (int i = 1; i <= cnt; i++) pai[i] += pai[i - 1];
  for (int i = 1; i <= cnt; i++) a[pai[len[i]]--] = i;
  for (int i = cnt; i; i--) {
    int p = a[i];
    for (int j = 0; j < 3; j++)
      tot[j][fa[p]] = (tot[j][fa[p]] + tot[j][p]) % mod;
  }
}
char ch[N];
int minl = 19260817;
long long ans[N << 2];
int main() {
  for (int i = 0; i < 3; i++) {
    scanf("%s", ch + 1);
    int las = strlen(ch + 1);
    minl = min(minl, las);
    las = 1;
    for (int j = 1; ch[j]; j++) las = extend(ch[j] - 'a', las, i);
  }
  calc();
  for (int i = 1; i <= cnt; i++) {
    long long k = (tot[0][i] * tot[1][i] % mod) * tot[2][i] % mod;
    ans[len[fa[i]] + 1] = (ans[len[fa[i]] + 1] + k) % mod;
    ans[len[i] + 1] = (ans[len[i] + 1] - k) % mod;
  }
  for (int i = 1; i <= minl; i++)
    ans[i] = (ans[i] + ans[i - 1]) % mod,
    printf("%lld\n", (ans[i] + mod) % mod);
  return 0;
}
