#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
int const N = 6e5 + 20, C = 27, mod = 1e9 + 7;
int n = N;
int sz, last, nxt[N][C], len[N], link[N], occur[3][N];
int ord[N], cnt[N];
int ans[N];
inline void extend(int id, int c) {
  int p = last, x = last = sz++;
  len[x] = len[p] + 1;
  occur[id][x]++;
  while (~p && nxt[p][c] == -1) nxt[p][c] = x, p = link[p];
  if (p == -1)
    link[x] = 0;
  else {
    int y = nxt[p][c];
    if (len[y] == len[p] + 1)
      link[x] = y;
    else {
      int z = sz++;
      memcpy(nxt[z], nxt[y], sizeof nxt[y]);
      len[z] = len[p] + 1, link[z] = link[y];
      link[x] = link[y] = z;
      while (~p && nxt[p][c] == y) nxt[p][c] = z, p = link[p];
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  memset(nxt, -1, sizeof nxt);
  len[0] = 0, link[0] = -1;
  sz++;
  for (int i = 0; i < 3; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < (int)s.size(); j++) extend(i, s[j] - 'a');
    extend(0, 26);
    n = min(n, (int)s.size());
  }
  for (int i = 0; i < sz; i++) cnt[len[i]]++;
  for (int i = 1; i < N; i++) cnt[i] += cnt[i - 1];
  for (int i = 0; i < sz; i++) ord[--cnt[len[i]]] = i;
  for (int i = sz - 1; i; i--)
    for (int j = 0; j < 3; j++) occur[j][link[ord[i]]] += occur[j][ord[i]];
  for (int i = 1; i < sz; i++) {
    int tmp = 1ll * occur[0][i] * occur[1][i] % mod * occur[2][i] % mod;
    int l = len[link[i]] + 1, r = len[i];
    ans[l] = (ans[l] + tmp) % mod, ans[r + 1] = (ans[r + 1] + mod - tmp) % mod;
  }
  for (int i = 1; i <= n; i++) {
    ans[i] = (ans[i - 1] + ans[i]) % mod;
    cout << ans[i] << ' ';
  }
  cout << '\n';
}
