#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7, maxn = 3e5 + 10;
int f[maxn], c[maxn], x[maxn], y[maxn], sa[maxn], rk[maxn], height[maxn],
    id[maxn], b[maxn][3], n, len, min_len, ans[maxn], a[maxn], m;
char s[maxn], t[maxn];
inline void ckmin(int &x, int y) { (x > y) && (x = y); }
inline void upd(int &x, int y) {
  x += y;
  (x >= P) && (x -= P);
}
void build_sa(char *s, int n) {
  register int cnt = 0;
  for (int i = (1); i <= (m); ++i) c[i] = 0;
  for (int i = (1); i <= (n); ++i) c[x[i] = s[i]]++;
  for (int i = (2); i <= (m); ++i) c[i] += c[i - 1];
  for (int i = (n); i >= (1); --i) sa[c[x[i]]--] = i;
  for (register int k = 1; k < n; k <<= 1) {
    cnt = 0;
    for (int i = (n - k + 1); i <= (n); ++i) y[++cnt] = i;
    for (int i = (1); i <= (n); ++i)
      if (sa[i] > k) y[++cnt] = sa[i] - k;
    for (int i = (1); i <= (m); ++i) c[i] = 0;
    for (int i = (1); i <= (n); ++i) c[x[i]]++;
    for (int i = (2); i <= (m); ++i) c[i] += c[i - 1];
    for (int i = (n); i >= (1); --i) sa[c[x[y[i]]]--] = y[i];
    swap(x, y);
    x[sa[1]] = 1;
    cnt = 1;
    for (int i = (2); i <= (n); ++i)
      x[sa[i]] = (y[sa[i]] == y[sa[i - 1]] && y[sa[i] + k] == y[sa[i - 1] + k])
                     ? cnt
                     : ++cnt;
    if (cnt == n) break;
    m = cnt;
  }
}
void get_height(char *s, int n) {
  register int k = 0;
  for (int i = (1); i <= (n); ++i) rk[sa[i]] = i;
  for (int i = (1); i <= (n); ++i) {
    if (rk[i] == 1) continue;
    if (k) --k;
    int j = sa[rk[i] - 1];
    while (i + k <= n && j + k <= n && s[i + k] == s[j + k]) ++k;
    height[rk[i]] = k;
  }
}
inline bool cmp(int x, int y) { return height[x] > height[y]; }
int gfa(int x) { return (f[x] ^ x) ? (f[x] = gfa(f[x])) : x; }
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  min_len = len;
  for (int i = (1); i <= (len); ++i) t[++n] = s[i], a[n] = 1;
  t[++n] = '#';
  scanf("%s", s + 1);
  len = strlen(s + 1);
  ckmin(min_len, len);
  for (int i = (1); i <= (len); ++i) t[++n] = s[i], a[n] = 2;
  t[++n] = '#' + 1;
  scanf("%s", s + 1);
  len = strlen(s + 1);
  ckmin(min_len, len);
  for (int i = (1); i <= (len); ++i) t[++n] = s[i], a[n] = 3;
  m = 127;
  build_sa(t, n);
  get_height(t, n);
  for (int i = (1); i <= (n); ++i) a[i] && (b[i][a[i] - 1] = 1);
  for (int i = (1); i <= (n); ++i) f[i] = i, id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  int j = 1, fxk = 0;
  for (int i = (min_len); i >= (1); --i) {
    while (j <= n && height[id[j]] >= i) {
      int u = gfa(sa[id[j] - 1]), v = gfa(sa[id[j]]);
      fxk = (fxk - 1ll * b[u][0] * b[u][1] % P * b[u][2] % P + P) % P;
      fxk = (fxk - 1ll * b[v][0] * b[v][1] % P * b[v][2] % P + P) % P;
      upd(b[u][0], b[v][0]);
      upd(b[u][1], b[v][1]);
      upd(b[u][2], b[v][2]);
      f[v] = u;
      fxk = (fxk + 1ll * b[u][0] * b[u][1] % P * b[u][2] % P) % P;
      ++j;
    }
    ans[i] = fxk;
  }
  for (int i = (1); i <= (min_len); ++i) printf("%d ", ans[i]);
  return 0;
}
