#include <bits/stdc++.h>
using namespace std;
int n, num, last;
int ch[1800010][27], link[1800010], dp[1800010], cnt[1800010], id[1800010],
    add[3][1800010];
char s[1800010];
void extend(int x, int c) {
  int p = last, np = last = ++num;
  dp[np] = dp[p] + 1, add[x][np] = 1;
  while (p && !ch[p][c]) ch[p][c] = np, p = link[p];
  if (!p)
    link[np] = 1;
  else {
    int q = ch[p][c];
    if (dp[q] == dp[p] + 1)
      link[np] = q;
    else {
      int nq = ++num;
      memcpy(ch[nq], ch[q], sizeof ch[nq]);
      link[nq] = link[q], link[q] = link[np] = nq;
      dp[nq] = dp[p] + 1;
      while (p && ch[p][c] == q) ch[p][c] = nq, p = link[p];
    }
  }
}
int ans[1800010];
int main() {
  last = ++num;
  int minn = 1e9;
  for (int i = 0; i < 3; i++) {
    scanf("%s", s);
    int len = strlen(s);
    minn = min(minn, len);
    for (int j = 0; j < len; j++) extend(i, s[j] - 'a');
    extend(0, 26);
    n += len + 1;
  }
  for (int i = 1; i <= num; i++) cnt[dp[i]]++;
  for (int i = 1; i <= n; i++) cnt[i] += cnt[i - 1];
  for (int i = num; i; i--) id[cnt[dp[i]]--] = i;
  for (int i = num; i; i--)
    for (int j = 0; j < 3; j++) add[j][link[id[i]]] += add[j][id[i]];
  for (int i = 1; i <= num; i++) {
    int tmp = (long long)add[0][id[i]] * add[1][id[i]] % 1000000007 *
              add[2][id[i]] % 1000000007;
    int l = dp[link[id[i]]] + 1, r = dp[id[i]];
    ans[l] = (ans[l] + tmp) % 1000000007,
    ans[r + 1] = (ans[r + 1] - tmp) % 1000000007;
  }
  for (int i = 1; i <= minn; i++) {
    ans[i] = ((ans[i] + ans[i - 1]) % 1000000007 + 1000000007) % 1000000007;
    printf("%d ", ans[i]);
  }
  return 0;
}
