#include <bits/stdc++.h>
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
const int N = 300003, MOD = (int)1e9 + 7;
char str[N];
int a[N], sa[N], r[N], h[N];
void suffixArray(int n, int m) {
  fill_n(h, m, 0);
  for (int i = (0); i < (n); i++) h[a[i]]++;
  for (int i = (1); i < (m); i++) h[i] += h[i - 1];
  for (int i = (n); --i >= (0);) sa[--h[a[i]]] = i;
  int k = 1;
  for (;; k *= 2) {
    int j = 0;
    for (int i = (n - k); i < (n); i++) r[j++] = i;
    for (int i = (0); i < (n); i++)
      if (sa[i] >= k) r[j++] = sa[i] - k;
    fill_n(h, m, 0);
    for (int i = (0); i < (n); i++) h[a[r[i]]]++;
    for (int i = (1); i < (m); i++) h[i] += h[i - 1];
    for (int i = (n); --i >= (0);) sa[--h[a[r[i]]]] = r[i];
    m = 1;
    h[sa[0]] = 0;
    for (int i = (1); i < (n); i++) {
      if (a[sa[i - 1]] != a[sa[i]] || max(sa[i - 1], sa[i]) + k >= n ||
          a[sa[i - 1] + k] != a[sa[i] + k])
        m++;
      h[sa[i]] = m - 1;
    }
    copy_n(h, n, a);
    if (m == n) break;
  }
  k = 0;
  for (int i = (0); i < (n); i++)
    if (a[i]) {
      int j = sa[a[i] - 1];
      for (; i + k < n && j + k < n && str[i + k] == str[j + k]; k++)
        ;
      h[a[i]] = k;
      k&& k--;
    }
}
struct E {
  int lcp, l, s[3];
};
int main() {
  int m = N, n = 0, bound[2];
  for (int w = (0); w < (3); w++) {
    scanf("%s", str + n);
    int l = strlen(str + n);
    m = min(m, l);
    for (int i = (0); i < (l); i++) a[n + i] = str[n + i] -= 'a';
    n += l;
    if (w != 2) {
      a[n] = str[n] = 26;
      n++;
      bound[w] = n;
    }
  }
  suffixArray(n, 27);
  fill_n(r, m + 1, 0);
  stack<E> S;
  for (int i = (1); i < (n + 1); i++) {
    int l = i - 1, hh = i == n ? 0 : h[i], s[3] = {};
    if (sa[i - 1] < bound[0])
      s[0]++;
    else if (sa[i - 1] < bound[1])
      s[1]++;
    else
      s[2]++;
    while (!S.empty() && S.top().lcp > hh) {
      E x = S.top();
      S.pop();
      l = x.l;
      for (int j = (0); j < (3); j++) s[j] += x.s[j];
      int lcp2 = max(S.empty() ? 0 : S.top().lcp, hh),
          t = (long long)(s[0]) * (s[1]) % MOD * (s[2]) % MOD;
      (r[x.lcp] += t) %= MOD;
      (r[lcp2] -= t) %= MOD;
    }
    if (i < n) {
      if (S.empty() || S.top().lcp < hh)
        S.push({hh, l, {s[0], s[1], s[2]}});
      else
        for (int j = (0); j < (3); j++) S.top().s[j] += s[j];
    }
  }
  for (int i = (m); --i >= (1);) (r[i] += r[i + 1]) %= MOD;
  for (int i = (1); i < (m + 1); i++)
    printf("%d%c", (r[i] + MOD) % MOD, " \n"[i == m]);
}
