#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 600010;
int wa[maxn], wb[maxn], wv[maxn], wts[maxn];
int cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void init_sa(char *r, int *sa, int n, int m) {
  int i, j, *x = wa, *y = wb, *t;
  int p;
  for (i = 0; i < m; i++) wts[i] = 0;
  for (i = 0; i < n; i++) wts[x[i] = r[i]]++;
  for (i = 0; i < m; i++) wts[i] += wts[i - 1];
  for (i = n - 1; i >= 0; --i) sa[--wts[x[i]]] = i;
  for (j = 1, p = 1; p < n; j <<= 1, 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++) wts[i] = 0;
    for (i = 0; i < n; i++) wts[wv[i]]++;
    for (i = 1; i < m; i++) wts[i] += wts[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--wts[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;
}
int rnk[maxn], height[maxn];
void calheight(char *r, int *sa, int n) {
  int i, j, k = 0;
  for (i = 1; i < n; i++) rnk[sa[i]] = i;
  for (i = 0; i < n - 1; height[rnk[i++]] = k)
    for (k ? k-- : 0, j = sa[rnk[i] - 1]; r[i + k] == r[j + k]; k++)
      ;
}
char s[maxn], t[maxn];
int sa[maxn];
int a[maxn], b[maxn];
long long c[maxn];
bool cmpb(const int &x, const int &y) { return height[x] > height[y]; }
int pa[maxn], sum[maxn][3];
int find(int x) {
  if (x == pa[x]) return x;
  return pa[x] = find(pa[x]);
}
int main() {
  int mi = maxn;
  memset(a, -1, sizeof a);
  scanf("%s", s);
  int len = strlen(s);
  mi = min(mi, len);
  for (int i = 0; i < len; i++) a[i] = 0;
  s[len] = '$';
  len++;
  scanf("%s", s + len);
  mi = min(mi, (int)strlen(s + len));
  len = strlen(s);
  for (int i = 0; i < len; i++) {
    if (a[i] == -1 && s[i] != '$') a[i] = 1;
  }
  s[len] = '#';
  len++;
  scanf("%s", s + len);
  mi = min(mi, (int)strlen(s + len));
  len = strlen(s);
  for (int i = 0; i < len; i++) {
    if (a[i] == -1 && s[i] != '#' && s[i] != '$') a[i] = 2;
  }
  s[len] = '!';
  len++;
  init_sa(s, sa, len, 256);
  calheight(s, sa, len);
  for (int i = 0; i < len; i++) {
    b[i] = pa[i] = i;
    sum[rnk[i]][0] = sum[rnk[i]][1] = sum[rnk[i]][2] = 0;
    if (a[i] != -1) sum[rnk[i]][a[i]] = 1;
  }
  sort(b + 1, b + len, cmpb);
  long long res = 0;
  int p = 1;
  for (int l = len - 1; l >= 1; l--) {
    while (p < len && height[b[p]] >= l) {
      int fp = find(b[p]);
      int pre = find(b[p] - 1);
      res = (res - 1LL * sum[pre][0] * sum[pre][1] % mod * sum[pre][2] % mod +
             mod) %
            mod;
      res =
          (res - 1LL * sum[fp][0] * sum[fp][1] % mod * sum[fp][2] % mod + mod) %
          mod;
      for (int j = 0; j < 3; j++) sum[pre][j] += sum[fp][j];
      res = (res + 1LL * sum[pre][0] * sum[pre][1] % mod * sum[pre][2] % mod) %
            mod;
      pa[fp] = pre;
      p++;
    }
    c[l] = res;
  }
  for (int i = 1; i <= mi; i++) {
    if (i == 1)
      printf("%d", c[i]);
    else
      printf(" %d", c[i]);
  }
  puts("");
  return 0;
}
