#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
long long n, tot = 1, root = 1, las, mi = 200000000;
long long fa[600010], len[600010], ch[600010][30], siz[600010][5], ans[600010];
char s[600010];
void insert(int c, int type) {
  int p = las, np = las = ++tot;
  len[np] = len[p] + 1, siz[np][type] = 1;
  while (p && !ch[p][c]) ch[p][c] = np, p = fa[p];
  if (!p)
    fa[np] = root;
  else {
    int q = ch[p][c];
    if (len[q] == len[p] + 1)
      fa[np] = q;
    else {
      int nq = ++tot;
      memcpy(ch[nq], ch[q], sizeof(ch[q]));
      len[nq] = len[p] + 1, fa[nq] = fa[q], fa[np] = fa[q] = nq;
      while (ch[p][c] == q) ch[p][c] = nq, p = fa[p];
    }
  }
}
void build(int type) {
  scanf("%s", s + 1), mi = min(mi, n = strlen(s + 1)), las = 1;
  for (int i = 1; i <= n; ++i) insert(s[i] - 'a' + 1, type);
}
struct edge {
  int to, nxt;
} e[600010];
int head[600010], edge_cnt;
void add(int from, int to) {
  e[++edge_cnt] = (edge){to, head[from]};
  head[from] = edge_cnt;
}
void dfs(int x) {
  for (int i = head[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    dfs(y);
    for (int type = 1; type <= 3; ++type) siz[x][type] += siz[y][type];
  }
}
void calc() {
  for (int i = 2; i <= tot; ++i) add(fa[i], i);
  dfs(root);
  for (int i = 2; i <= tot; ++i) {
    long long val = siz[i][1] * siz[i][2] % 1000000007 * siz[i][3] % 1000000007;
    ans[len[fa[i]] + 1] = (ans[len[fa[i]] + 1] + val) % 1000000007;
    ans[len[i] + 1] = (ans[len[i] + 1] - val + 1000000007) % 1000000007;
  }
  for (int i = 1; i <= mi; ++i) ans[i] = (ans[i] + ans[i - 1]) % 1000000007;
}
int main() {
  build(1), build(2), build(3), calc();
  for (int i = 1; i <= mi; ++i) printf("%lld ", ans[i]);
  return 0;
}
