#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 3e5 + 10;
struct Sam {
  struct gg {
    int nxt[28], fa, mx, mn;
  } node[2 * N];
  int wh, las, cnt, tax[2 * N], rnk[2 * N], m;
  long long dp[3][2 * N], ans[N];
  void init() {
    memset(node, 0, sizeof node);
    memset(dp, 0, sizeof dp);
    memset(tax, 0, sizeof tax);
    memset(ans, 0, sizeof ans);
    cnt = las = 1, m = N;
  }
  void add(int x) {
    static int p, np, t, nt;
    p = las, np = ++cnt, las = np;
    node[np].mx = node[p].mx + 1;
    dp[wh][np]++;
    while (p && !node[p].nxt[x]) {
      node[p].nxt[x] = np;
      p = node[p].fa;
    }
    if (!p)
      node[np].fa = node[np].mn = 1;
    else {
      t = node[p].nxt[x];
      if (node[p].mx + 1 == node[t].mx)
        node[np].fa = t, node[np].mn = node[t].mx + 1;
      else {
        nt = ++cnt, node[nt].mx = node[p].mx + 1;
        memcpy(node[nt].nxt, node[t].nxt, sizeof node[t].nxt);
        node[nt].fa = node[t].fa;
        node[t].fa = node[np].fa = nt;
        node[nt].mn = node[node[nt].fa].mx + 1;
        node[t].mn = node[np].mn = node[nt].mx + 1;
        for (; node[p].nxt[x] == t; p = node[p].fa) node[p].nxt[x] = nt;
      }
    }
  }
  void sss() {
    for (int i = 1; i <= cnt; i++) tax[node[i].mx]++;
    for (int i = 1; i <= N; i++) tax[i] += tax[i - 1];
    for (int i = 1; i <= cnt; i++) rnk[tax[node[i].mx]--] = i;
  }
  void dfs() {
    int nw;
    for (int i = cnt; i >= 1; i--) {
      nw = rnk[i];
      dp[0][node[nw].fa] += dp[0][nw];
      dp[1][node[nw].fa] += dp[1][nw];
      dp[2][node[nw].fa] += dp[2][nw];
    }
  }
  void solve() {
    int l, r;
    long long nw;
    for (int i = 2; i <= cnt; i++) {
      l = node[i].mn, r = node[i].mx;
      nw = 1;
      nw = nw * dp[0][i] % mod;
      nw = nw * dp[1][i] % mod;
      nw = nw * dp[2][i] % mod;
      ans[l] = (ans[l] + nw) % mod;
      ans[r + 1] = (ans[r + 1] - nw + mod) % mod;
    }
    for (int i = 1; i <= m; i++)
      ans[i] = (ans[i] + ans[i - 1]) % mod, printf("%lld ", ans[i]);
  }
} sam;
char s[N];
int len;
int main() {
  sam.init();
  for (int i = 0; i < 3; i++) {
    sam.wh = i;
    scanf("%s", s + 1);
    len = strlen(s + 1), sam.m = min(sam.m, len);
    for (int j = 1; j <= len; j++) sam.add(s[j] - 'a');
    if (i != 2) sam.add(i + 1 + 25);
  }
  sam.sss(), sam.dfs();
  sam.solve();
}
