#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int wa[900005], wb[900005], wv[900005], wc[900005];
int sa[900005], rnk[900005], height[900005];
template <typename T>
void build_SA(T *r, int n, int m) {
  int *x = wa, *y = wb;
  for (register int i = 0; i < m; ++i) wc[i] = 0;
  for (register int i = 0; i < n; ++i) ++wc[x[i] = r[i]];
  for (register int i = 1; i < m; ++i) wc[i] += wc[i - 1];
  for (register int i = n; ~--i;) sa[--wc[x[i]]] = i;
  for (register int j = 1, p = 1; p < n; j <<= 1, m = p) {
    p = 0;
    for (register int i = n - j; i < n; ++i) y[p++] = i;
    for (register int i = 0; i < n; ++i)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (register int i = 0; i < n; ++i) wv[i] = x[y[i]];
    for (register int i = 0; i < m; ++i) wc[i] = 0;
    for (register int i = 0; i < n; ++i) ++wc[wv[i]];
    for (register int i = 1; i < m; ++i) wc[i] += wc[i - 1];
    for (register int i = n; ~--i;) sa[--wc[wv[i]]] = y[i];
    swap(x, y), x[*sa] = 0, p = 1;
    for (register int i = 1; i < n; ++i)
      x[sa[i]] =
          (y[sa[i - 1]] == y[sa[i]] && y[sa[i - 1] + j] == y[sa[i] + j] ? p - 1
                                                                        : p++);
  }
  for (register int i = 1; i < n; ++i) rnk[sa[i]] = i;
  for (register int i = 0, k = 0, j; i < n - 1; height[rnk[i++]] = k)
    for (k && (--k), j = sa[rnk[i] - 1];
         i + k < n && j + k < n && r[i + k] == r[j + k]; ++k)
      ;
}
int len1, len2, len;
long long ans[300005];
char str[900005];
vector<int> all[300005];
int fa[900005], sz[900005][3];
inline int fnd(int x) { return fa[x] == x ? x : fa[x] = fnd(fa[x]); }
inline long long merge(int x, int y) {
  x = fnd(x), y = fnd(y);
  long long ans = 0;
  ans += 1LL * sz[x][0] * sz[y][1] * sz[y][2];
  ans += 1LL * sz[x][1] * sz[y][2] * sz[y][0];
  ans += 1LL * sz[x][2] * sz[y][0] * sz[y][1];
  ans += 1LL * sz[y][0] * sz[x][1] * sz[x][2];
  ans += 1LL * sz[y][1] * sz[x][2] * sz[x][0];
  ans += 1LL * sz[y][2] * sz[x][0] * sz[x][1];
  fa[y] = x;
  sz[x][0] += sz[y][0];
  sz[x][1] += sz[y][1];
  sz[x][2] += sz[y][2];
  return ans % mod;
}
int main() {
  scanf("%s", str);
  len1 = strlen(str), str[len1] = '$';
  scanf("%s", str + len1 + 1);
  len2 = strlen(str), str[len2] = '#';
  scanf("%s", str + len2 + 1);
  len = strlen(str);
  build_SA(str, len, 128);
  int m = min({len1, len2 - len1 - 1, len - len2 - 1});
  for (int i = 3; i <= len; ++i) all[height[i]].push_back(i);
  for (int i = 2; i <= len; ++i) {
    fa[i] = i, sz[i][0] = sz[i][1] = sz[i][2] = 0;
    if (sa[i] <= len1)
      sz[i][0] = 1;
    else if (sa[i] <= len2)
      sz[i][1] = 1;
    else
      sz[i][2] = 1;
  }
  for (int i = len - 1; i >= 1; --i)
    for (int x : all[i]) (ans[i] += merge(x - 1, x)) %= mod;
  for (int i = m; --i;) (ans[i] += ans[i + 1]) %= mod;
  for (int i = 1; i <= m; ++i) printf("%lld%c", ans[i], " \n"[i == m]);
  return 0;
}
