#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
const int mod = 1e9 + 7;
long long ans[maxn];
int n, m;
int len1, len2, len3;
struct edge {
  int v, nxt;
} e[maxn];
int head[maxn], ecnt = 0;
void add(int u, int v) {
  e[++ecnt] = (edge){v, head[u]};
  head[u] = ecnt;
}
struct suffix_automaton {
  int son[maxn][26], fa[maxn];
  int cnt, cur, lst;
  int siz[maxn][4], len[maxn];
  int tot[maxn], sa[maxn];
  void init() {
    memset(head, -1, sizeof(head));
    cur = cnt = 1;
  }
  void insert(int c, int id) {
    lst = cur, cur = ++cnt;
    int p = lst;
    len[cur] = len[p] + 1, siz[cur][id] = 1;
    while (p && !son[p][c]) son[p][c] = cur, p = fa[p];
    if (!p)
      fa[cur] = 1;
    else {
      int q = son[p][c];
      if (len[q] == len[p] + 1)
        fa[cur] = q;
      else {
        int now_q = ++cnt;
        len[now_q] = len[p] + 1;
        memcpy(son[now_q], son[q], sizeof(son[q]));
        fa[now_q] = fa[q], fa[q] = fa[cur] = now_q;
        while (son[p][c] == q) son[p][c] = now_q, p = fa[p];
      }
    }
  }
  void dfs(int u) {
    for (int i = head[u]; ~i; i = e[i].nxt) {
      int v = e[i].v;
      dfs(v);
      for (int j = 1; j <= 3; j++) siz[u][j] += siz[v][j];
    }
  }
  void sortf() {
    for (int i = 2; i <= cnt; i++) add(fa[i], i);
    dfs(1);
    for (int i = 2; i <= cnt; i++) {
      long long now = siz[i][1] * 1LL * siz[i][2] % mod * siz[i][3] % mod;
      ans[len[fa[i]] + 1] += now, ans[len[fa[i]] + 1] %= mod;
      ans[len[i] + 1] -= now, ans[len[i] + 1] %= mod;
    }
    for (int i = 1; i <= m; i++)
      ans[i] += ans[i - 1], ans[i] = (ans[i] % mod + mod) % mod;
  }
} aut;
char s[maxn];
int main() {
  aut.init();
  scanf("%s", s + 1);
  len1 = strlen(s + 1);
  m = n = len1;
  for (int i = 1; i <= len1; i++) aut.insert(s[i] - 'a', 1);
  aut.cur = 1;
  scanf("%s", s + 1);
  len2 = strlen(s + 1);
  n = max(len2, n), m = min(m, len2);
  for (int i = 1; i <= len2; i++) aut.insert(s[i] - 'a', 2);
  aut.cur = 1;
  scanf("%s", s + 1);
  len3 = strlen(s + 1);
  n = max(len3, n), m = min(m, len3);
  for (int i = 1; i <= len3; i++) aut.insert(s[i] - 'a', 3);
  aut.sortf();
  for (int i = 1; i <= m; i++) printf("%lld\n", ans[i]);
  return 0;
}
