#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline string get() {
  char ch[2000010];
  scanf("%s", ch);
  return ch;
}
const int MAX_LG = 21;
const long long maxn = 2e6 + 10;
const long long maxm = 1e5 + 10;
const long long base = 29;
const long long mod = 1e9 + 7;
const long long base2 = 31;
const long long mod2 = 1e9 + 9;
const long long INF = 2e18 + 100;
const long long SQ = 317;
struct state {
  long long len = 0, link = -1;
  map<char, long long> nxt;
} st[maxn];
long long sz = 1;
long long last;
inline void add_letter(char c) {
  long long p = last;
  last = sz++;
  st[last].len = st[p].len + 1;
  for (; p != -1 && st[p].nxt[c] == 0; p = st[p].link) {
    st[p].nxt[c] = last;
  }
  if (p == -1) {
    st[last].link = 0;
    return;
  }
  long long q = st[p].nxt[c];
  if (st[q].len == st[p].len + 1) {
    st[last].link = q;
    return;
  }
  long long cl = sz++;
  st[cl].nxt = st[q].nxt;
  st[cl].link = st[q].link;
  st[q].link = st[last].link = cl;
  st[cl].len = st[p].len + 1;
  for (; p != -1 && st[p].nxt[c] == q; p = st[p].link) st[p].nxt[c] = cl;
}
long long lim;
long long res[maxn];
long long fi[maxn], se[maxn], th[maxn];
bool mark[maxn];
inline void dfs(long long state) {
  if (mark[state]) return;
  mark[state] = true;
  for (auto c : st[state].nxt) {
    dfs(c.second);
    if (c.first == '!')
      fi[state]++;
    else if (c.first == '@')
      se[state]++;
    else if (c.first == '#')
      th[state]++;
    else {
      fi[state] += fi[c.second];
      se[state] += se[c.second];
      th[state] += th[c.second];
    }
  }
}
inline void calc() {
  for (long long i = 0; i < sz; i++) {
    if (st[i].len == 0 || st[i].len > lim) continue;
    res[st[i].len] = (res[st[i].len] + fi[i] * se[i] % mod * th[i] % mod) % mod;
    if (st[i].link == 0) continue;
    res[st[st[i].link].len] =
        (res[st[st[i].link].len] - fi[i] * se[i] % mod * th[i] % mod + mod) %
        mod;
  }
}
int32_t main() {
  st[0].link = -1;
  string a = get(), b = get(), c = get();
  string s = a + '!' + b + '@' + c + '#';
  for (auto ch : s) add_letter(ch);
  lim = min(a.size(), min(b.size(), c.size()));
  dfs(0);
  calc();
  for (long long i = lim - 1; i >= 1; i--) {
    res[i] += res[i + 1];
    if (res[i] >= mod) res[i] -= mod;
  }
  for (long long i = 1; i <= lim; i++) cout << res[i] << " ";
}
