#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int n, m, x[300005], y[300005], c[300005], sa[300005], rk[300005], h[300005],
    fa[300005], len, belong[300005], id[300005];
char s[300005], a[300005];
long long ans[300005], sum[300005][3];
void get_sa() {
  int num;
  for (int i = 1; i <= n; i++) ++c[x[i] = s[i]];
  for (int i = 1; i <= m; i++) c[i] += c[i - 1];
  for (int i = n; i >= 1; i--) sa[c[x[i]]--] = i;
  for (int k = 1; k <= n; (k <<= 1)) {
    num = 0;
    for (int i = n - k + 1; i <= n; i++) y[++num] = i;
    for (int i = 1; i <= n; i++) {
      if (sa[i] > k) y[++num] = sa[i] - k;
    }
    memset(c, 0, sizeof c);
    for (int i = 1; i <= n; i++) ++c[x[i]];
    for (int i = 1; i <= m; i++) c[i] += c[i - 1];
    for (int i = n; i >= 1; i--) sa[c[x[y[i]]]--] = y[i], y[i] = 0;
    swap(x, y);
    x[sa[1]] = 1;
    num = 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])
                     ? num
                     : (++num);
    if (num == n) return;
    m = num;
  }
}
void get_height() {
  h[1] = 0;
  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++;
    h[rk[i]] = k;
  }
}
int findSet(int x) {
  if (fa[x] != x) fa[x] = findSet(fa[x]);
  return fa[x];
}
bool cmp(int x, int y) { return h[x] > h[y]; }
int main() {
  scanf("%s", a + 1);
  int l = strlen(a + 1), len = l;
  for (int i = 1; i <= l; i++) s[++n] = a[i], belong[n] = 1;
  s[++n] = '{';
  scanf("%s", a + 1);
  l = strlen(a + 1), len = min(l, len);
  for (int i = 1; i <= l; i++) s[++n] = a[i], belong[n] = 2;
  s[++n] = '}';
  scanf("%s", a + 1);
  l = strlen(a + 1), len = min(len, l);
  for (int i = 1; i <= l; i++) s[++n] = a[i], belong[n] = 3;
  m = '}';
  get_sa();
  get_height();
  for (int i = 1; i <= n; i++) id[i] = i, fa[i] = i;
  sort(id + 1, id + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    if (belong[i] == 1) sum[i][0]++;
    if (belong[i] == 2) sum[i][1]++;
    if (belong[i] == 3) sum[i][2]++;
  }
  long long tmp = 0;
  int now = 1;
  for (int i = len; i >= 1; i--) {
    while (now <= n && h[id[now]] >= i) {
      int u = findSet(sa[id[now] - 1]), v = findSet(sa[id[now]]);
      fa[v] = u;
      tmp = (tmp - sum[u][0] * sum[u][1] % mod * sum[u][2] % mod + mod) % mod;
      tmp = (tmp - sum[v][0] * sum[v][1] % mod * sum[v][2] % mod + mod) % mod;
      sum[u][0] = (sum[u][0] + sum[v][0]) % mod;
      sum[u][1] = (sum[u][1] + sum[v][1]) % mod;
      sum[u][2] = (sum[u][2] + sum[v][2]) % mod;
      tmp = (tmp + sum[u][0] * sum[u][1] % mod * sum[u][2] % mod) % mod;
      now++;
    }
    ans[i] = tmp;
  }
  for (int i = 1; i <= len; i++) printf("%lld ", ans[i]);
  return 0;
}
