#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 100;
int num, lena, lenb, lenc;
int fa[N], sa[N], fir[N], sec[N], t[N], id[N];
int height[N], L[N], R[N], st[N];
char a[N], b[N], c[N], d[N];
const long long mod = 1000000007;
long long sum[N][3], ans[N];
bool cmp(int x, int y) { return height[x] > height[y]; }
int get(int x) { return x == fa[x] ? x : fa[x] = get(fa[x]); }
inline void SA(int len, char s[]) {
  num = 300;
  for (int i = 1; i <= num; i++) t[i] = 0;
  for (int i = 1; i <= len; i++) ++t[fir[i] = s[i]];
  for (int i = 1; i <= num; i++) t[i] += t[i - 1];
  for (int i = len; i >= 1; i--) sa[t[fir[i]]--] = i;
  for (int k = 1; k <= len; k <<= 1) {
    int cnt = 0;
    for (int i = len - k + 1; i <= len; i++) sec[++cnt] = i;
    for (int i = 1; i <= len; i++)
      if (sa[i] > k) sec[++cnt] = sa[i] - k;
    for (int i = 1; i <= num; i++) t[i] = 0;
    for (int i = 1; i <= len; i++) ++t[fir[i]];
    for (int i = 1; i <= num; i++) t[i] += t[i - 1];
    for (int i = len; i >= 1; i--) sa[t[fir[sec[i]]]--] = sec[i], sec[i] = 0;
    swap(fir, sec);
    fir[sa[1]] = 1, cnt = 1;
    for (int i = 2; i <= len; i++)
      fir[sa[i]] =
          (sec[sa[i]] == sec[sa[i - 1]] && sec[sa[i] + k] == sec[sa[i - 1] + k])
              ? cnt
              : ++cnt;
    if (cnt == len) break;
    num = cnt;
  }
  int j, k = 0;
  for (int i = 1; i <= len; i++) {
    if (k) k--;
    int j = sa[fir[i] - 1];
    while (i + k <= len && j + k <= len && s[i + k] == s[j + k]) k++;
    height[fir[i]] = k;
  }
  for (int i = 1; i <= lena; i++) sum[i][0] = 1;
  for (int i = lena + 2; i <= lena + 1 + lenb; i++) sum[i][1] = 1;
  for (int i = lena + lenb + 3; i <= len; i++) sum[i][2] = 1;
  for (int i = 1; i <= len; i++) fa[i] = i, id[i] = i;
  sort(id + 1, id + 1 + len, cmp);
  int now = 1;
  long long temp = 0;
  for (int i = len; i >= 1; i--) {
    while (now <= len && height[id[now]] >= i) {
      int u = get(sa[id[now] - 1]), v = get(sa[id[now]]);
      temp -= 1ll * sum[u][0] * sum[u][1] * sum[u][2] % mod;
      temp = (temp + mod) % mod;
      temp -= 1ll * sum[v][0] * sum[v][1] * sum[v][2] % mod;
      temp = (temp + 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;
      temp += (sum[u][0] * sum[u][1] * sum[u][2] % mod);
      temp %= mod;
      now++;
      fa[v] = u;
    }
    ans[i] = temp;
  }
}
int main() {
  scanf("%s%s%s", a + 1, b + 1, c + 1);
  lena = strlen(a + 1), lenb = strlen(b + 1), lenc = strlen(c + 1);
  for (int i = 1; i <= lena; i++) d[i] = a[i];
  d[lena + 1] = 'z' + 1;
  for (int i = 1; i <= lenb; i++) d[i + lena + 1] = b[i];
  d[lena + lenb + 2] = 'z' + 2;
  for (int i = 1; i <= lenc; i++) d[i + lena + lenb + 2] = c[i];
  SA(lena + lenb + lenc + 2, d);
  for (int i = 1; i <= min({lena, lenb, lenc}); i++) printf("%lld ", ans[i]);
  puts("");
  return 0;
}
