#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
vector<pair<int, int> > v;
vector<int> vec[maxn];
string s[5];
int n[5];
long long hsh[maxn][5], pw[maxn];
long long base = 757, mod = 1e9 + 7;
int par[maxn];
long long ta[maxn], tb[maxn], tc[maxn], ans[maxn];
int mx, mn;
inline long long get_hash(int l, int r, int i) {
  return hsh[r][i] - hsh[l][i] * pw[r - l];
}
inline void make_vec(int sz, int ind) {
  for (int i = 0; i < sz; i++) {
    v.push_back({i, ind});
  }
}
inline void do_hash(string s, int j) {
  for (int i = 0; i < s.size(); i++) {
    hsh[i + 1][j] = (hsh[i][j] * base + s[i]);
  }
}
inline void input() {
  cin >> s[0] >> s[1] >> s[2];
  n[0] = s[0].size(), n[1] = s[1].size(), n[2] = s[2].size();
  mx = max({n[0], n[1], n[2]});
  mn = min({n[0], n[1], n[2]});
  make_vec(n[0], 0);
  make_vec(n[1], 1);
  make_vec(n[2], 2);
  pw[0] = 1;
  for (int i = 0; i <= mx; i++) {
    pw[i + 1] = pw[i] * base;
  }
  do_hash(s[0], 0);
  do_hash(s[1], 1);
  do_hash(s[2], 2);
}
inline int lcp(pair<int, int> x, pair<int, int> y) {
  int l = 0, r = max(n[x.second] - x.first, n[y.second] - y.first) + 1;
  while (l + 1 < r) {
    int mid = (l + r) / 2;
    if (get_hash(x.first, x.first + mid, x.second) ==
        get_hash(y.first, y.first + mid, y.second)) {
      l = mid;
    } else {
      r = mid;
    }
  }
  return l;
}
inline bool cmp(pair<int, int> x, pair<int, int> y) {
  int l = lcp(x, y);
  if (n[x.second] == x.first + l || n[y.second] == y.first + l) {
    return n[x.second] - x.first < n[y.second] - y.first;
  }
  return s[x.second][x.first + l] < s[y.second][y.first + l];
}
long long cur = 0;
inline int find_par(int x) {
  if (x == par[x]) {
    return x;
  }
  return par[x] = find_par(par[x]);
}
inline void merge(int x, int y) {
  x = find_par(x);
  y = find_par(y);
  cur -=
      (ta[x] * tb[x] % mod * tc[x] % mod + ta[y] * tb[y] % mod * tc[y] % mod) %
      mod;
  cur = (cur % mod + mod) % mod;
  ta[x] += ta[y];
  tb[x] += tb[y];
  tc[x] += tc[y];
  cur += ta[x] * tb[x] % mod * tc[x] % mod;
  cur %= mod;
  par[y] = x;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  input();
  sort(v.begin(), v.end(), cmp);
  for (int i = 0; i < v.size() - 1; i++) {
    int lc = lcp(v[i], v[i + 1]);
    vec[lc].push_back(i);
  }
  for (int i = 0; i < v.size(); i++) {
    par[i] = i;
    ta[i] = (v[i].second == 0);
    tb[i] = (v[i].second == 1);
    tc[i] = (v[i].second == 2);
  }
  for (int i = mx; i >= 1; i--) {
    for (int u : vec[i]) {
      merge(u, u + 1);
    }
    ans[i] = cur;
  }
  for (int i = 1; i <= mn; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
