#include <bits/stdc++.h>
using namespace std;
const int maxn = 6e5 + 5;
int wa[maxn], wb[maxn], wv[maxn], wc[maxn];
int r[maxn], sa[maxn], rak[maxn], height[maxn], SIGMA = 0;
int cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void da(int *r, int *sa, int n, int m) {
  int i, j, p, *x = wa, *y = wb, *t;
  for (i = 0; i < m; i++) wc[i] = 0;
  for (i = 0; i < n; i++) wc[x[i] = r[i]]++;
  for (i = 1; i < m; i++) wc[i] += wc[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--wc[x[i]]] = i;
  for (j = 1, p = 1; p < n; j *= 2, m = p) {
    for (p = 0, i = n - j; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (i = 0; i < n; i++) wv[i] = x[y[i]];
    for (i = 0; i < m; i++) wc[i] = 0;
    for (i = 0; i < n; i++) wc[wv[i]]++;
    for (i = 1; i < m; i++) wc[i] += wc[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--wc[wv[i]]] = y[i];
    for (t = x, x = y, y = t, p = 1, x[sa[0]] = 0, i = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
  }
}
void calheight(int *r, int *sa, int n) {
  int i, j, k = 0;
  for (i = 1; i <= n; i++) rak[sa[i]] = i;
  for (i = 0; i < n; height[rak[i++]] = k) {
    for (k ? k-- : 0, j = sa[rak[i] - 1]; r[i + k] == r[j + k]; k++)
      ;
  }
}
const int MAXX = maxn, K = 20;
int lg[MAXX];
void pre() {
  lg[1] = 0;
  for (int i = 2; i < MAXX; i++) lg[i] = lg[i / 2] + 1;
}
struct RMQ {
  int N;
  vector<int> v[K];
  RMQ(const vector<int> &a) {
    N = a.size();
    v[0] = a;
    for (int k = 0; (1 << (k + 1)) <= N; k++) {
      v[k + 1].resize(N);
      for (int i = 0; i - 1 + (1 << (k + 1)) < N; i++) {
        v[k + 1][i] = min(v[k][i], v[k][i + (1 << k)]);
      }
    }
  }
  int findMin(int i, int j) const {
    assert(i <= j);
    int k = lg[j - i + 1];
    return min(v[k][i], v[k][j + 1 - (1 << k)]);
  }
};
void suffixArray(const string &s, vector<int> &suffArray, vector<int> &lcp,
                 vector<int> &length, RMQ &rmq) {
  int n = s.size();
  SIGMA = 0;
  for (int i = 0; i < n; i++) {
    if ('a' <= s[i] && s[i] <= 'z')
      r[i] = s[i] - 'a' + 2;
    else
      r[i] = 1;
    SIGMA = max(SIGMA, r[i]);
  }
  r[n] = 0;
  da(r, sa, n + 1, SIGMA + 1);
  suffArray.resize(n);
  for (int i = 0; i < n; i++) suffArray[i] = sa[i + 1];
  calheight(r, sa, n);
  lcp.resize(n - 1);
  for (int i = 0; i + 1 < n; i++) lcp[i] = height[i + 2];
  for (int i = 3; i < lcp.size(); i++) {
    lcp[i] = min(lcp[i], min(length[suffArray[i]], length[suffArray[i + 1]]));
  }
  rmq = RMQ(lcp);
}
struct SuffixTree {
  vector<int> edg[MAXX];
  int length[MAXX];
  int L[MAXX], R[MAXX];
  int SZ;
  int n;
  void buildGraph(const vector<int> &sa, const vector<int> &lcp,
                  const vector<int> &slength, const RMQ &rmq) {
    n = sa.size();
    SZ = 1;
    length[0] = 0;
    L[0] = 0;
    R[0] = n - 1;
    stack<int> st;
    st.push(0);
    for (int i = 0; i < sa.size(); i++) {
      int last = i == 0 ? 0 : lcp[i - 1];
      while (length[st.top()] > last) st.pop();
      int len = slength[sa[i]];
      while (last < len) {
        int r = expandRight(i, last, rmq);
        if (i < r)
          last = rmq.findMin(i, r - 1);
        else
          last = len;
        length[SZ] = last;
        L[SZ] = i;
        R[SZ] = r;
        edg[st.top()].push_back(SZ);
        st.push(SZ);
        SZ++;
      }
    }
  }
  int expandRight(int i, int last, const RMQ &rmq) {
    int r = i;
    for (int k = K - 1; k >= 0; k--) {
      int j = r + (1 << k);
      if (j >= n) continue;
      if (rmq.findMin(i, j - 1) > last) r = j;
    }
    return r;
  }
} st;
pair<int, int> whom[MAXX];
int cumsum[4][MAXX];
const long long MOD = 1000000007;
long long ans[MAXX];
void dfs(const string &s, const vector<int> &sa, int u) {
  for (int v : st.edg[u]) {
    if (s[sa[st.L[v]]] == '#') continue;
    long long mul = 1;
    mul = cumsum[1][st.R[v]] - cumsum[1][st.L[v] - 1];
    mul = (mul * (cumsum[2][st.R[v]] - cumsum[2][st.L[v] - 1])) % MOD;
    mul = (mul * (cumsum[3][st.R[v]] - cumsum[3][st.L[v] - 1])) % MOD;
    ans[st.length[u] + 1] += mul;
    ans[st.length[v] + 1] -= mul;
    dfs(s, sa, v);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  pre();
  RMQ rmq({1});
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  string s = s1 + "#" + s2 + "#" + s3 + "#";
  for (int i = 0; i < s1.size(); i++) whom[i] = pair<int, int>(1, i);
  for (int i = 0; i < s2.size(); i++)
    whom[s1.size() + 1 + i] = pair<int, int>(2, i);
  for (int i = 0; i < s3.size(); i++)
    whom[s1.size() + s2.size() + 2 + i] = pair<int, int>(3, i);
  vector<int> length;
  for (int i = 0; i < s1.size(); i++) length.push_back(s1.size() - i);
  length.push_back(0);
  for (int i = 0; i < s2.size(); i++) length.push_back(s2.size() - i);
  length.push_back(0);
  for (int i = 0; i < s3.size(); i++) length.push_back(s3.size() - i);
  length.push_back(0);
  vector<int> sa, lcp;
  suffixArray(s, sa, lcp, length, rmq);
  for (int i = 0; i < sa.size(); i++) {
    if (whom[sa[i]].first == 0) continue;
    cumsum[1][i] = cumsum[1][i - 1];
    cumsum[2][i] = cumsum[2][i - 1];
    cumsum[3][i] = cumsum[3][i - 1];
    cumsum[whom[sa[i]].first][i]++;
  }
  st.buildGraph(sa, lcp, length, rmq);
  dfs(s, sa, 0);
  int mn = min(s1.size(), min(s2.size(), s3.size()));
  for (int i = 1; i <= mn; i++) {
    ans[i] += ans[i - 1];
    ans[i] = (ans[i] % MOD + MOD) % MOD;
    cout << ans[i] << " ";
  }
  return 0;
}
