#include <bits/stdc++.h>
using namespace std;
const int N = 660000;
const int MOD = 1e9 + 7;
int E[N][28], P[N], L[N], C[N][3], cnt[N], ID[N], ans[N];
int m, cur;
int add_node() {
  ++m;
  memset(E[m], 0, sizeof(E[m]));
  P[m] = L[m] = 0;
  memset(C[m], 0, sizeof(C[m]));
  return m;
}
void init() {
  m = cur = 0;
  cur = add_node();
}
void extend(int i, int id, int c) {
  int x = cur, y = cur = add_node();
  L[y] = i;
  for (; x && !E[x][c]; x = P[x]) {
    E[x][c] = y;
  }
  if (!x) {
    P[y] = 1;
  } else {
    int z = E[x][c];
    if (L[z] == L[x] + 1) {
      P[y] = z;
    } else {
      int u = add_node();
      L[u] = L[x] + 1, memcpy(E[u], E[z], sizeof(E[u])), P[u] = P[z],
      P[z] = P[y] = u;
      for (; x && E[x][c] == z; x = P[x]) {
        E[x][c] = u;
      }
    }
  }
  C[cur][id]++;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string a, b, c;
  cin >> a >> b >> c;
  int na = a.length();
  int nb = b.length();
  int nc = c.length();
  init();
  for (int i = 0; i < na; i++) extend(i + 1, 0, a[i] - 'a');
  extend(na + 1, 0, 26);
  for (int i = 0; i < nb; i++) extend(i + 2 + na, 1, b[i] - 'a');
  extend(na + 2 + nb, 1, 27);
  for (int i = 0; i < nc; i++) extend(i + 3 + na + nb, 2, c[i] - 'a');
  for (int i = 1; i <= m; i++) cnt[L[i]]++;
  for (int i = 1; i <= na + nb + nc + 2; i++) cnt[i] += cnt[i - 1];
  for (int i = m; i > 0; i--) ID[cnt[L[i]]--] = i;
  for (int i = m; i > 1; i--) {
    int u = ID[i], v = P[u];
    for (int j : {0, 1, 2}) C[v][j] += C[u][j];
    int now = 1LL * C[u][0] * C[u][1] * C[u][2] % MOD;
    ans[L[v] + 1] = (ans[L[v] + 1] + now) % MOD;
    ans[L[u] + 1] = (ans[L[u] + 1] + MOD - now) % MOD;
  }
  for (int i = 1; i <= min(nc, min(na, nb)); i++) {
    ans[i] = (ans[i] + ans[i - 1]) % MOD;
    cout << ans[i] << " \n"[i == min(nc, min(na, nb))];
  }
  return 0;
}
