#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ans = 0, fh = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ans = ans * 10 + ch - '0', ch = getchar();
  return ans * fh;
}
const int maxn = 6e5 + 100;
const int P = 1e9 + 7;
struct SAM {
  struct node {
    int son[26], link, len, cnt[3];
  } st[maxn];
  int las, tot;
  inline void sam_init() { st[las = tot = 0].link = -1; }
  inline void extend(char c, int ms) {
    int cur = ++tot, z = c - 'a';
    st[cur].len = st[las].len + 1;
    st[cur].cnt[ms]++;
    int p = las;
    while (~p && !st[p].son[z]) st[p].son[z] = cur, p = st[p].link;
    if (p == -1)
      st[cur].link = 0;
    else {
      int q = st[p].son[z];
      if (st[q].len == st[p].len + 1)
        st[cur].link = q;
      else {
        int clo = ++tot;
        st[clo].len = st[p].len + 1;
        st[clo].link = st[q].link;
        for (int i = 0; i < 26; i++) st[clo].son[i] = st[q].son[i];
        while (~p && st[p].son[z] == q) st[p].son[z] = clo, p = st[p].link;
        st[cur].link = st[q].link = clo;
      }
    }
    las = cur;
  }
} sam;
int n = 0x7fffffff, a[maxn];
char s[maxn];
vector<int> e[maxn];
void dfs(int x) {
  for (int i = 0, lim = e[x].size(); i < lim; i++) {
    int y = e[x][i];
    dfs(y);
    for (int j = 0; j < 3; j++) (sam.st[x].cnt[j] += sam.st[y].cnt[j]) %= P;
  }
  long long tmp = 1;
  for (int i = 0; i < 3; i++) tmp = tmp * sam.st[x].cnt[i] % P;
  (a[sam.st[sam.st[x].link].len + 1] += tmp) %= P;
  (a[sam.st[x].len + 1] -= tmp) %= P;
}
int main() {
  sam.sam_init();
  for (int i = 0; i < 3; i++) {
    scanf("%s", s + 1);
    int len = strlen(s + 1);
    (n = min(n, len)), sam.las = 0;
    for (int j = 1; j <= len; j++) sam.extend(s[j], i);
  }
  for (int i = 1; i <= sam.tot; i++) e[sam.st[i].link].push_back(i);
  dfs(0);
  int len = 0;
  for (int i = 1; i <= n; i++) {
    len = (len + a[i]) % P;
    printf("%d ", (len + P) % P);
  }
  return 0;
}
