#include <bits/stdc++.h>
using namespace std;
long long bit[300010];
void update(int i, long long val) {
  while (i < 300010) {
    bit[i] = (bit[i] + val) % 1000000007;
    i += (i & (-i));
  }
}
long long query(int i) {
  long long ret = 0;
  while (i) {
    ret = (ret + bit[i]) % 1000000007;
    i -= (i & (-i));
  }
  return ret;
}
int getint(char c) {
  if (c >= 'a' && c <= 'z') return c - 'a';
  if (c == '0') return 26;
  if (c == '1') return 27;
  return 28;
}
struct suffix_automata {
  vector<int> Next[2 * 300010];
  int link[2 * 300010], len[2 * 300010], dp[3][2 * 300010];
  bool mark[2 * 300010];
  int node_cnt, last;
  suffix_automata() {
    for (int i = 0; i < 2 * 300010; ++i) Next[i].resize(29, 0);
    link[0] = -1;
    len[0] = 0;
    last = 0;
    node_cnt = 1;
    memset(mark, 0, sizeof(mark));
  }
  void add_letter(int c) {
    int cur = node_cnt++;
    int it = last;
    len[cur] = len[last] + 1;
    last = cur;
    while (it != -1) {
      if (Next[it][c] != 0) break;
      Next[it][c] = cur;
      it = link[it];
    }
    if (it == -1) return (void)(link[cur] = 0);
    if (len[it] + 1 == len[Next[it][c]]) return (void)(link[cur] = Next[it][c]);
    int clone = node_cnt++, q = Next[it][c];
    link[clone] = link[q];
    for (int i = 0; i < 29; ++i) Next[clone] = Next[q];
    len[clone] = len[it] + 1;
    link[cur] = link[q] = clone;
    while (it != -1) {
      if (Next[it][c] != q) break;
      Next[it][c] = clone;
      it = link[it];
    }
  }
  void go(int cur) {
    if (mark[cur]) return;
    mark[cur] = 1;
    dp[0][cur] = dp[1][cur] = dp[2][cur] = 0;
    for (int i = 0; i < 29; i++)
      if (Next[cur][i]) {
        if (i == 26)
          dp[0][cur]++;
        else if (i == 27)
          dp[1][cur]++;
        else if (i == 28)
          dp[2][cur]++;
        else {
          go(Next[cur][i]);
          for (int j = 0; j < 3; j++) dp[j][cur] += dp[j][Next[cur][i]];
        }
      }
    if (cur) {
      long long val = (1ll * dp[0][cur] * dp[1][cur]) % 1000000007;
      val = (val * dp[2][cur]) % 1000000007;
      update(len[link[cur]] + 1, val);
      update(len[cur] + 1, (1000000007 - val) % 1000000007);
    }
  }
} SA;
int main() {
  memset(bit, 0, sizeof(bit));
  int i, out_len = 300010;
  string s = "", t;
  for (i = 0; i < 3; i++) {
    cin >> t;
    s += t;
    s += (char)('0' + i);
    out_len = min(out_len, (int)t.length());
  }
  for (auto c : s) SA.add_letter(getint(c));
  SA.go(0);
  for (i = 1; i <= out_len; i++) printf("%lld ", query(i));
  printf("\n");
}
