#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  int f;
  char c;
  for (f = 1, c = getchar(); c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -f;
  for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
  x *= f;
}
template <typename T>
inline void write(T x) {
  static char q[64];
  int cnt = 0;
  if (!x) putchar('0');
  if (x < 0) putchar('-'), x = -x;
  while (x) q[cnt++] = x % 10 + '0', x /= 10;
  while (cnt--) putchar(q[cnt]);
}
const int maxn = 300005;
int son[maxn << 1][26], pa[maxn << 1], len[maxn << 1], sz[maxn << 1][3], tot,
    q[maxn << 1], d[maxn << 1];
int extend(int p, int x, int sta) {
  int now = ++tot;
  len[now] = len[p] + 1;
  while (~p && !son[p][x]) son[p][x] = now, p = pa[p];
  if (!~p)
    pa[now] = 0;
  else {
    int d = son[p][x];
    if (len[d] == len[p] + 1)
      pa[now] = d;
    else {
      int _d = ++tot;
      len[_d] = len[p] + 1;
      for (int i = 0; i < 26; ++i) son[_d][i] = son[d][i];
      while (~p && son[p][x] == d) son[p][x] = _d, p = pa[p];
      pa[_d] = pa[d];
      pa[d] = pa[now] = _d;
    }
  }
  int o = 0;
  while (sta) sz[now][o++] = sta & 1, sta >>= 1;
  return now;
}
int tr[maxn][26], num, pos[maxn], flag[maxn];
long long sm[maxn];
int main() {
  pa[0] = -1;
  int all = 0x3f3f3f3f;
  for (int i = 0; i < 3; ++i) {
    int now = 0, n = 0;
    char c = getchar();
    while (c < 'a' || c > 'z') c = getchar();
    while (c >= 'a' && c <= 'z') {
      int o = c - 'a';
      ++n;
      if (!tr[now][o]) tr[now][o] = ++num;
      now = tr[now][o];
      flag[now] |= 1 << i;
      c = getchar();
    }
    all = min(all, n);
  }
  int fro = 0, bac = 0;
  q[bac++] = 0;
  while (fro < bac) {
    int u = q[fro++];
    for (int i = 0; i < 26; ++i) {
      int v = tr[u][i];
      if (!v) continue;
      pos[q[bac++] = v] = extend(pos[u], i, flag[v]);
    }
  }
  fro = bac = 0;
  for (int i = 1; i <= tot; ++i) ++d[pa[i]];
  for (int i = 1; i <= tot; ++i)
    if (!d[i]) q[bac++] = i;
  while (fro < bac) {
    int u = q[fro++];
    if (!u) continue;
    for (int i = 0; i < 3; ++i) sz[pa[u]][i] += sz[u][i];
    long long tmp = 1ll * sz[u][0] * sz[u][1] * sz[u][2];
    sm[len[pa[u]] + 1] += tmp, sm[len[u] + 1] -= tmp;
    ;
    if (!(--d[pa[u]])) q[bac++] = pa[u];
  }
  for (int i = 1; i <= all; ++i)
    write((sm[i] += sm[i - 1]) % 1000000007), putchar(" \n"[i == all]);
  return 0;
}
