#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const int L = 20;
const long long mod = 1e9 + 7;
const int inf = 1e9 + 10;
int Rank[N][L], P[N], prv[N], nxt[N], lcp[N], cnt[N][3], pw, n;
long long ans[N];
string s;
stack<int> st;
bool cmp(int x, int y) {
  if (Rank[x][pw - 1] != Rank[y][pw - 1])
    return Rank[x][pw - 1] < Rank[y][pw - 1];
  if (n < max(x, y) + (1 << (pw - 1))) return y < x;
  return Rank[x + (1 << (pw - 1))][pw - 1] < Rank[y + (1 << (pw - 1))][pw - 1];
}
void build() {
  for (int i = 1; i <= n; i++) Rank[i][0] = s[i - 1], P[i] = i;
  for (pw = 1; pw < L; pw++) {
    sort(P + 1, P + n + 1, cmp);
    Rank[P[1]][pw] = 1;
    for (int i = 2; i <= n; i++)
      Rank[P[i]][pw] = Rank[P[i - 1]][pw] + cmp(P[i - 1], P[i]);
  }
}
int LCP(int x, int y) {
  int res = 0;
  if (y < x) swap(x, y);
  if (x == 0) return 0;
  for (int i = L - 1; i >= 0; i--)
    if (y + (1 << i) <= n + 1 && Rank[x][i] == Rank[y][i])
      x += 1 << i, y += 1 << i, res += 1 << i;
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  s = s1 + '#' + s2 + '$' + s3;
  n = (int)(s.size());
  build();
  for (int i = 1; i < n; i++) lcp[i] = LCP(P[i], P[i + 1]);
  lcp[0] = -inf;
  st.push(0);
  for (int i = 1; i < n; i++) {
    while (lcp[i] <= lcp[st.top()]) st.pop();
    prv[i] = st.top();
    st.push(i);
  }
  while ((int)(st.size())) st.pop();
  lcp[n] = -inf;
  st.push(n);
  for (int i = n - 1; i; i--) {
    while (lcp[i] < lcp[st.top()]) st.pop();
    nxt[i] = st.top();
    st.push(i);
  }
  for (int i = 1; i <= n; i++) {
    if (P[i] == (int)(s1.size()) + 1 ||
        P[i] == (int)(s1.size()) + (int)(s2.size()) + 2)
      continue;
    for (int j = 0; j < 3; j++) cnt[i][j] = cnt[i - 1][j];
    if (P[i] <= (int)(s1.size()))
      cnt[i][0]++;
    else if (P[i] <= (int)(s1.size()) + (int)(s2.size()) + 1)
      cnt[i][1]++;
    else
      cnt[i][2]++;
  }
  for (int i = 1; i < n; i++) {
    ans[lcp[i]] += 1LL * (cnt[nxt[i]][0] - cnt[prv[i]][0]) *
                   (cnt[nxt[i]][1] - cnt[prv[i]][1]) *
                   (cnt[nxt[i]][2] - cnt[prv[i]][2]);
    ans[lcp[i]] -= 1LL * (cnt[i][0] - cnt[prv[i]][0]) *
                   (cnt[i][1] - cnt[prv[i]][1]) * (cnt[i][2] - cnt[prv[i]][2]);
    ans[lcp[i]] -= 1LL * (cnt[nxt[i]][0] - cnt[i][0]) *
                   (cnt[nxt[i]][1] - cnt[i][1]) * (cnt[nxt[i]][2] - cnt[i][2]);
    ans[lcp[i]] %= mod;
  }
  for (int i = N - 10; i; i--) ans[i] = (ans[i] + ans[i + 1]) % mod;
  for (int i = 1;
       i <= min({(int)(s1.size()), (int)(s2.size()), (int)(s3.size())}); i++)
    cout << ans[i] << ' ';
  return 0;
}
