#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 22, N = 27;
const int MOD = 1e9 + 7;
struct SAM {
  int mxCnt[maxn << 1], son[maxn << 1][N], fa[maxn << 1], pos[maxn << 1];
  int flag[maxn << 1][3];
  int root, last, DFN, t;
  int create() {
    ++t;
    mxCnt[t] = pos[t] = fa[t] = NULL;
    for (int i = 0; i < 3; ++i) flag[t][i] = NULL;
    for (int i = 0; i < N; ++i) son[t][i] = NULL;
    return t;
  }
  void init() {
    DFN = 1;
    ++DFN;
    t = 0, root = 1;
    last = create();
  }
  void addChar(int x, int _pos, int id) {
    int p = last;
    if (son[p][x]) {
      int q = son[p][x];
      if (mxCnt[p] + 1 == mxCnt[q]) {
        last = q;
        flag[q][id] = DFN;
        return;
      }
      int nq = create();
      for (int i = 0; i < N; ++i) son[nq][i] = son[q][i];
      fa[nq] = fa[q];
      pos[nq] = pos[q];
      mxCnt[nq] = mxCnt[p] + 1;
      flag[nq][id] = DFN;
      fa[q] = nq;
      for (; p && son[p][x] == q; p = fa[p]) son[p][x] = nq;
      last = nq;
      return;
    }
    int np = create();
    last = np;
    mxCnt[np] = mxCnt[p] + 1, pos[np] = _pos, flag[np][id] = DFN;
    for (; p && son[p][x] == NULL; p = fa[p]) son[p][x] = np;
    if (p == NULL) {
      fa[np] = root;
      return;
    }
    int q = son[p][x];
    if (mxCnt[q] == mxCnt[p] + 1) {
      fa[np] = q;
      return;
    }
    int nq = create();
    flag[nq][id] = DFN - 1;
    pos[nq] = pos[q];
    for (int i = 0; i < N; ++i) son[nq][i] = son[q][i];
    fa[nq] = fa[q], mxCnt[nq] = mxCnt[p] + 1;
    fa[q] = nq, fa[np] = nq;
    for (; p && son[p][x] == q; p = fa[p]) son[p][x] = nq;
  }
  int dp[maxn << 1][3], in[maxn << 1], que[maxn << 1];
  void topo() {
    int head = 0, tail = 0;
    for (int i = 2; i <= t; ++i) {
      for (int j = 0; j < 3; ++j) {
        dp[i][j] = flag[i][j] == DFN;
      }
      in[fa[i]]++;
    }
    for (int i = 2; i <= t; ++i) {
      if (in[i] == 0) que[tail++] = i;
    }
    while (head < tail) {
      int cur = que[head++];
      if (cur == root) break;
      for (int i = 0; i < 3; ++i) dp[fa[cur]][i] += dp[cur][i];
      in[fa[cur]]--;
      if (in[fa[cur]] == 0) que[tail++] = fa[cur];
    }
  }
} sam;
char str[maxn], sub[maxn];
long long int ans[maxn << 1];
void work() {
  int len = (0x3f3f3f3f);
  sam.init();
  for (int i = 0; i < 3; ++i) {
    sam.last = sam.root;
    scanf("%s", str + 1);
    int t = strlen(str + 1);
    len = min(len, t);
    for (int j = 1; str[j]; ++j) {
      sam.addChar(str[j] - 'a', j, i);
    }
  }
  sam.topo();
  for (int i = 2; i <= sam.t; ++i) {
    long long int res = 1;
    for (int j = 0; j < 3; ++j) {
      res = res * sam.dp[i][j] % MOD;
    }
    ans[sam.mxCnt[sam.fa[i]] + 1] = (ans[sam.mxCnt[sam.fa[i]] + 1] + res) % MOD;
    ans[sam.mxCnt[i] + 1] = (ans[sam.mxCnt[i] + 1] - res + MOD) % MOD;
  }
  for (int i = 1; i <= len; ++i) ans[i] = (ans[i] + ans[i - 1] + MOD) % MOD;
  for (int i = 1; i <= len; ++i) {
    printf("%I64d ", ans[i]);
  }
}
int main() {
  work();
  return 0;
}
