#include <bits/stdc++.h>
using namespace std;
const int N = 300050;
const int mod = 1000000007;
int wa[N], wb[N], wv[N], wss[N], rak[N], height[N], n, sa[N], be[N], ca[N];
char s[N], s1[N], s2[N], s3[N];
long long ans[N];
int pa[N], mn[N], mx[N], sum[5][N];
void init() {
  for (int i = 0; i < N; i++) mn[i] = mx[i] = pa[i] = i;
}
int findset(int x) {
  if (x != pa[x]) pa[x] = findset(pa[x]);
  return pa[x];
}
void union_nodes(int a, int b) {
  int c = max(a, b);
  int d = min(a, b);
  int a1 = findset(c);
  int b1 = findset(d);
  if (a1 != b1) {
    mx[b1] = max(mx[b1], mx[a1]);
    mn[b1] = min(mn[b1], mn[a1]);
    pa[a1] = b1;
  }
}
queue<int> q[N];
int cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void da(int *r, int *sa, int n, int M) {
  int i, j, p, *x = wa, *y = wb, *t;
  for (i = 0; i < M; i++) wss[i] = 0;
  for (i = 0; i < n; i++) wss[x[i] = r[i]]++;
  for (i = 1; i < M; i++) wss[i] += wss[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--wss[x[i]]] = i;
  for (j = 1, p = 1; p < n; j *= 2, M = p) {
    for (p = 0, i = n - j; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (i = 0; i < n; i++) wv[i] = x[y[i]];
    for (i = 0; i < M; i++) wss[i] = 0;
    for (i = 0; i < n; i++) wss[wv[i]]++;
    for (i = 1; i < M; i++) wss[i] += wss[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--wss[wv[i]]] = y[i];
    for (t = x, x = y, y = t, p = 1, x[sa[0]] = 0, i = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
  }
  return;
}
void calheight(int *r, int *sa, int n) {
  int i, j, k = 0;
  for (i = 1; i <= n; i++) rak[sa[i]] = i;
  for (i = 0; i < n; height[rak[i++]] = k)
    for (k ? k-- : 0, j = sa[rak[i] - 1]; r[i + k] == r[j + k]; k++)
      ;
  for (int i = n; i; i--) rak[i] = rak[i - 1], sa[i]++;
}
long long cal(int l, int r) {
  long long a = sum[1][r] - sum[1][l - 1];
  long long b = sum[2][r] - sum[2][l - 1];
  long long c = sum[3][r] - sum[3][l - 1];
  return a * b * c % mod;
}
int main() {
  init();
  scanf("%s%s%s", s1 + 1, s2 + 1, s3 + 1);
  s1[0] = s2[0] = s3[0] = '#';
  strcat(s, s1), strcat(s, s2), strcat(s, s3);
  int len = min(min(strlen(s1 + 1), strlen(s2 + 1)), strlen(s3 + 1));
  n = strlen(s + 1);
  int t = 0;
  for (int i = 0; i <= n; i++) {
    if (s[i] == '#')
      t++;
    else
      be[i] = t;
  }
  t = 50;
  for (int i = 1; i <= n; i++)
    if (s[i] == '#')
      ca[i] = t++;
    else
      ca[i] = s[i] - 'a' + 1;
  ca[n + 1] = 0;
  da(ca + 1, sa, n + 1, 100);
  calheight(ca + 1, sa, n);
  for (int i = 1; i <= n; i++) q[height[i]].push(i);
  for (int i = 1; i <= n; i++) {
    sum[1][i] = sum[1][i - 1];
    sum[2][i] = sum[2][i - 1];
    sum[3][i] = sum[3][i - 1];
    sum[be[sa[i]]][i]++;
  }
  long long cnt = 0;
  for (int i = n; i; i--) {
    while (!q[i].empty()) {
      int bef = q[i].front() - 1;
      int nex = q[i].front();
      int fa1 = findset(bef);
      int fa2 = findset(nex);
      cnt = (cnt - cal(mn[fa1], mx[fa1]) - cal(mn[fa2], mx[fa2])) % mod + mod;
      union_nodes(fa1, fa2);
      fa1 = findset(fa1);
      cnt = (cnt + cal(mn[fa1], mx[fa1])) % mod;
      q[i].pop();
    }
    ans[i] = cnt % mod;
  }
  for (int i = 1; i <= len; i++) printf("%d ", ans[i]);
}
