#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int N, SA[4600005], lcp[4600005];
char S[4600005];
int cnt[4600005], a[2][4600005];
void SuffixArray() {
  int i, j, k;
  int m = 255;
  int *x = a[0], *y = a[1];
  for (i = 1; i <= N; i++) cnt[x[i] = S[i]]++;
  for (i = 1; i <= m; i++) cnt[i] += cnt[i - 1];
  for (i = N; i; i--) SA[cnt[x[i]]--] = i;
  int bit = 1;
  for (int len = 1, p = 1; p < N; len <<= 1, m = p) {
    for (p = 0, i = N - len; ++i <= N;) y[++p] = i;
    for (i = 1; i <= N; i++)
      if (SA[i] > len) y[++p] = SA[i] - len;
    for (i = 0; i <= m; i++) cnt[i] = 0;
    for (i = 1; i <= N; i++) cnt[x[y[i]]]++;
    for (i = 1; i <= m; i++) cnt[i] += cnt[i - 1];
    for (i = N; i; i--) SA[cnt[x[y[i]]]--] = y[i];
    x = a[bit];
    y = a[bit ^ 1];
    bit ^= 1;
    p = 1;
    x[SA[1]] = 1;
    for (i = 1; i < N; i++)
      x[SA[i + 1]] = SA[i] + len <= N && SA[i + 1] + len <= N &&
                             y[SA[i]] == y[SA[i + 1]] &&
                             y[SA[i] + len] == y[SA[i + 1] + len]
                         ? p
                         : ++p;
  }
}
int mrank[4600005];
void LCP() {
  int i, j, k = 0;
  for (i = 1; i <= N; i++) mrank[SA[i]] = i;
  for (i = 1; i <= N; lcp[mrank[i++]] = k)
    for (k ? k-- : 0, j = SA[mrank[i] - 1]; S[i + k] == S[j + k]; k++)
      ;
}
int add(int x, int y) { return ((x + y) % mod + mod) % mod; }
int mul(int x, int y) { return (long long)x * y % mod; }
int mypow(int x, int c) {
  int ret = 1;
  while (c > 0) {
    if (c & 1) {
      ret = mul(ret, x);
    }
    c /= 2;
    x = mul(x, x);
  }
  return ret;
}
int preSum[3][4600005];
string s[3];
int dsu[4600005], la[4600005], lb[4600005];
int f(int x) {
  if (x == dsu[x]) {
    return x;
  }
  return dsu[x] = f(dsu[x]);
}
int rr = 0;
int getAll(int x, int y) {
  int ret = 1;
  for (int i = 0; i < 3; ++i) {
    ret = mul(ret, preSum[i][y] - preSum[i][x - 1]);
  }
  return ret;
}
bool merge(int x, int y) {
  x = f(x), y = f(y);
  if (x != y) {
    dsu[x] = y;
    rr = add(rr, -getAll(la[x], lb[x]));
    rr = add(rr, -getAll(la[y], lb[y]));
    la[y] = min(la[y], la[x]);
    lb[y] = max(lb[y], lb[x]);
    rr = add(rr, getAll(la[y], lb[y]));
    return true;
  }
  return false;
}
int ret[4600005];
void solve() {
  int mmlen = 4600005;
  N = 0;
  for (int i = 0; i < 3; ++i) {
    cin >> s[i];
    mmlen = min(mmlen, (int)s[i].size());
    for (int j = 0; j < (int)s[i].size(); ++j) {
      S[++N] = s[i][j];
    }
    if (i != 2) S[++N] = '#';
  }
  for (int i = N; i; --i) {
    dsu[i] = i;
    la[i] = lb[i] = i;
  }
  SuffixArray();
  LCP();
  int nn = -1;
  for (int i = N; i; --i) {
    if (SA[i] <= s[0].size()) {
      nn = i;
    }
  }
  vector<pair<int, int> > in;
  for (int i = 1; i <= N; ++i) {
    int st = 1, ed = 1;
    if (i >= 2) {
      in.push_back({lcp[i], i});
    }
    for (int j = 0; j < 3; ++j) {
      preSum[j][i] = preSum[j][i - 1];
      ed += s[j].size() - 1;
      if (st <= SA[i] && SA[i] <= ed) {
        ++preSum[j][i];
      }
      st += s[j].size() + 1;
      ed = st;
    }
  }
  sort(in.begin(), in.end());
  int pos = in.size() - 1;
  for (int l = mmlen; l >= 1; --l) {
    while (pos >= 0) {
      if (in[pos].first >= l) {
        merge(in[pos].second - 1, in[pos].second);
        --pos;
      } else {
        break;
      }
    }
    ret[l] = rr;
  }
  for (int i = 1; i <= mmlen; ++i) {
    printf("%d ", ret[i]);
  }
  putchar('\n');
}
int main() {
  solve();
  return 0;
}
