#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 10, md = 1e9 + 7;
long long p = 31;
string s[3];
long long n[3];
long long pw[MAXN], h[3][MAXN];
vector<pair<long long, long long>> suffix;
long long get(long long l, long long r, long long index) {
  return h[index][r] - h[index][l] * pw[r - l];
}
long long length(pair<long long, long long> a, pair<long long, long long> b) {
  long long l = 0, r = min(n[a.second] - a.first, n[b.second] - b.first) + 1;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    if (get(a.first, a.first + mid, a.second) ==
        get(b.first, b.first + mid, b.second))
      l = mid;
    else
      r = mid;
  }
  return l;
}
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  long long l = length(a, b);
  if (l == n[a.second] - a.first) return true;
  if (l == n[b.second] - b.second) return false;
  return s[b.second][b.first + l] > s[a.second][a.first + l];
}
long long cnt[3][MAXN][3];
long long in[3][MAXN];
struct K {
  pair<long long, long long> left, right;
  long long l;
} a1;
bool cmp1(K a, K b) { return a.l > b.l; }
pair<long long, long long> par[3][MAXN];
pair<long long, long long> find(pair<long long, long long> a) {
  pair<long long, long long> now = par[a.second][a.first];
  if (par[now.second][now.first] == now) return now;
  return par[a.second][a.first] = find(now);
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  pw[0] = 1;
  for (long long i = 1; i < MAXN; ++i) pw[i] = pw[i - 1] * p;
  cin >> s[0] >> s[1] >> s[2];
  for (long long now = 0; now < 3; ++now) {
    n[now] = s[now].size();
    for (long long i = 1; i <= n[now]; ++i) {
      h[now][i] = h[now][i - 1] * p + s[now][i - 1];
      suffix.push_back({i - 1, now});
      ++cnt[now][i - 1][now];
      par[now][i - 1] = {i - 1, now};
    }
  }
  sort(suffix.begin(), suffix.end(), cmp);
  vector<K> vctr;
  long long sz = suffix.size();
  for (long long i = 0; i < sz - 1; ++i) {
    a1.left = suffix[i];
    a1.right = suffix[i + 1];
    a1.l = length(suffix[i], suffix[i + 1]);
    vctr.push_back(a1);
  }
  sort(vctr.begin(), vctr.end(), cmp1);
  long long point = 0, now = 0;
  vector<long long> res;
  for (long long l = n[0]; l; --l) {
    while (point < sz - 1 && vctr[point].l >= l) {
      pair<long long, long long> v = find(vctr[point].left),
                                 u = find(vctr[point].right);
      if (u == v) continue;
      long long cur = 1;
      for (long long i = 0; i < 3; ++i)
        cur *= cnt[v.second][v.first][i] + cnt[u.second][u.first][i];
      cur %= md;
      long long cpy = cur;
      cur += (in[v.second][v.first] + in[u.second][u.first]) * (md - 1) % md;
      if (cur >= md) cur %= md;
      now += cur;
      if (now >= md) now %= md;
      par[v.second][v.first] = u;
      in[u.second][u.first] = cpy;
      for (long long i = 0; i < 3; ++i)
        cnt[u.second][u.first][i] += cnt[v.second][v.first][i];
      ++point;
    }
    res.push_back(now);
  }
  long long mn = min(n[0], min(n[1], n[2]));
  reverse(res.begin(), res.end());
  for (long long i = 0; i < mn; ++i) cout << res[i] << ' ';
  return 0;
}
