#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
const int mod = 1e9 + 7;
map<int, int> son[N * 2];
struct node {
  int len, fa;
  int size[4];
} a[N * 2 + 1];
struct Noo {
  int next, to;
} v[N * 2 + 1];
int head[N * 2], cnt;
void addd(int e, int r) {
  v[++cnt].next = head[e];
  v[cnt].to = r;
  head[e] = cnt;
}
char b[N];
int n, m, l;
int jl = 1, last = 1, tot = 1, q;
void add(int e, int id) {
  last = jl;
  jl = q = ++tot;
  a[q].size[id] = 1;
  a[q].len = a[last].len + 1;
  for (; last && !son[last][e]; last = a[last].fa) son[last][e] = q;
  if (!last) {
    a[q].fa = 1;
  } else {
    int h = son[last][e];
    if (a[h].len == a[last].len + 1) {
      a[q].fa = h;
    } else {
      int g = ++tot;
      a[g] = a[h];
      a[g].len = a[last].len + 1;
      son[g] = son[h];
      a[g].size[1] = 0;
      a[g].size[2] = 0;
      a[g].size[3] = 0;
      for (; last && son[last][e] == h; last = a[last].fa) son[last][e] = g;
      a[h].fa = a[q].fa = g;
    }
  }
}
void dfs(int u) {
  for (int i = head[u]; i; i = v[i].next) {
    dfs(v[i].to);
    a[u].size[1] = (1ll * a[u].size[1] + a[v[i].to].size[1]) % mod;
    a[u].size[2] = (1ll * a[u].size[2] + a[v[i].to].size[2]) % mod;
    a[u].size[3] = (1ll * a[u].size[3] + a[v[i].to].size[3]) % mod;
  }
}
long long f[N * 2];
void slove() {
  for (int i = 2; i <= tot; i++) {
    int af = 1ll * a[i].size[1] * 1ll * a[i].size[2] % mod * 1ll *
             a[i].size[3] % mod;
    if (af) {
      af %= mod;
      f[a[a[i].fa].len + 1] += af;
      f[a[a[i].fa].len + 1] %= mod;
      f[a[i].len + 1] -= af;
      f[a[i].len + 1] = (f[a[i].len + 1] + mod) % mod;
    }
  }
}
int main() {
  int summ = 19198100;
  for (int i = 1; i <= 3; i++) {
    scanf("%s", b + 1);
    l = strlen(b + 1);
    summ = min(summ, l);
    last = jl = 1;
    for (int k = 1; k <= l; k++) {
      add(b[k] - 'a', i);
    }
  }
  for (int i = 2; i <= tot; i++) addd(a[i].fa, i);
  dfs(1);
  slove();
  for (int i = 1; i <= summ; i++) {
    f[i] += f[i - 1];
    f[i] %= mod;
    printf("%lld ", f[i]);
  }
  return 0;
}
