#include <bits/stdc++.h>
using namespace std;
const int N = 6e5 + 6;
const int mod = 1e9 + 7;
int link[N], cnt = 1, len[N], nxt[N][26], in[N];
char s[N];
long long ans[N], num[N][4];
int insert(int c, int las, int o) {
  if (nxt[las][c]) {
    int p = las, q = nxt[las][c];
    if (len[p] + 1 == len[q]) {
      num[q][o]++;
      return q;
    } else {
      int clone = ++cnt;
      len[clone] = len[p] + 1;
      link[clone] = link[q];
      link[q] = clone;
      memcpy(nxt[clone], nxt[q], sizeof(nxt[q]));
      for (; nxt[p][c] == q; p = link[p]) nxt[p][c] = clone;
      num[clone][o]++;
      return clone;
    }
  }
  int cur = ++cnt;
  len[cur] = len[las] + 1;
  int p = las;
  for (; p && nxt[p][c] == 0; p = link[p]) nxt[p][c] = cur;
  if (!p)
    link[cur] = 1;
  else {
    int q = nxt[p][c];
    if (len[q] == len[p] + 1)
      link[cur] = q;
    else {
      int clone = ++cnt;
      len[clone] = len[p] + 1;
      link[clone] = link[q];
      link[q] = link[cur] = clone;
      memcpy(nxt[clone], nxt[q], sizeof(nxt[q]));
      for (; nxt[p][c] == q; p = link[p]) nxt[p][c] = clone;
    }
  }
  num[cur][o]++;
  return cur;
}
void topu() {
  queue<int> q;
  for (int i = 1; i <= cnt; i++) in[link[i]]++;
  for (int i = 2; i <= cnt; i++)
    if (!in[i]) q.push(i);
  while (!q.empty()) {
    int now = q.front();
    q.pop();
    if (now == 1) continue;
    for (int i = 1; i <= 3; i++) num[link[now]][i] += num[now][i];
    if (--in[link[now]] == 0) q.push(link[now]);
    long long v = num[now][1] * num[now][2] % mod * num[now][3] % mod;
    ans[len[link[now]] + 1] = (ans[len[link[now]] + 1] + v) % mod;
    ans[len[now] + 1] = (ans[len[now] + 1] - v + mod) % mod;
  }
}
int main() {
  int mi = 44444444;
  for (int j = 1; j <= 3; j++) {
    scanf("%s", s + 1);
    int len = strlen(s + 1), las = 1;
    mi = min(len, mi);
    for (int i = 1; i <= len; i++) las = insert(s[i] - 'a', las, j);
  }
  topu();
  long long pre = 0;
  for (int i = 1; i <= mi; i++) {
    pre = (pre + ans[i]) % mod;
    printf("%lld ", pre);
  }
  return 0;
}
