#include <bits/stdc++.h>
using namespace std;
const int maxn = 300000 + 10;
const int maxl = 20;
const long long base = 1e6;
const int inf = -1e9;
const long long mod = 1e9 + 7;
long long F[maxn][maxl][3], ans;
string s[3];
int sz, ps[maxn][3];
vector<pair<int, int> > suf;
vector<int> adj[maxn];
set<pair<int, int> > S;
set<pair<int, int> >::iterator it;
bool cmp(pair<int, int> a, pair<int, int> b) {
  return F[a.second][19][a.first] < F[b.second][19][b.first];
}
void suffixArray() {
  for (int id = 0; id < 3; id++)
    for (int i = 0; i < s[id].size(); i++) {
      F[i][0][id] = s[id][i] - 'a' + 1;
      suf.push_back(make_pair(id, i));
    }
  for (int l = 1; l < 20; l++) {
    vector<long long> v;
    for (int id = 0; id < 3; id++) {
      for (int i = 0; i < s[id].size(); i++) {
        if (i + (1 << (l - 1)) > s[id].size())
          F[i][l][id] = F[i][l - 1][id] * base;
        else
          F[i][l][id] =
              F[i][l - 1][id] * base + F[i + (1 << (l - 1))][l - 1][id];
        v.push_back(F[i][l][id]);
      }
    }
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
    for (int id = 0; id < 3; id++)
      for (int i = 0; i < s[id].size(); i++)
        F[i][l][id] =
            lower_bound(v.begin(), v.end(), F[i][l][id]) - v.begin() + 1;
  }
  sort(suf.begin(), suf.end(), cmp);
  S.insert(make_pair(0, sz - 1));
  ans =
      (long long)s[0].size() * (long long)s[1].size() * (long long)s[2].size();
}
int lcp(int p1, int id1, int p2, int id2) {
  int ret = 0;
  for (int l = 19; l >= 0; l--) {
    if (p1 + (1 << l) <= s[id1].size() && p2 + (1 << l) <= s[id2].size()) {
      if (F[p1][l][id1] == F[p2][l][id2]) {
        ret += (1 << l);
        p1 += (1 << l);
        p2 += (1 << l);
      }
    }
  }
  return ret;
}
long long get(int l, int r) {
  long long ret = 1;
  for (int id = 0; id < 3; id++) {
    long long cnt = 0;
    cnt = ps[r + 1][id] - ps[l][id];
    ret *= cnt;
  }
  return ret;
}
void update(int pos) {
  it = S.lower_bound(make_pair(pos + 1, inf));
  it--;
  ans -= get(it->first, it->second);
  ans += get(it->first, pos);
  ans += get(pos + 1, it->second);
  S.insert(make_pair(it->first, pos));
  S.insert(make_pair(pos + 1, it->second));
  S.erase(it);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s[0] >> s[1] >> s[2];
  sz = s[0].size() + s[1].size() + s[2].size();
  suffixArray();
  for (int i = 0; i < sz - 1; i++)
    adj[lcp(suf[i].second, suf[i].first, suf[i + 1].second, suf[i + 1].first)]
        .push_back(i);
  for (int i = 0; i < sz; i++) {
    for (int j = 0; j < 3; j++)
      if (i > 0) ps[i + 1][j] = ps[i][j];
    for (int j = 0; j < 3; j++) ps[i + 1][j] += (suf[i].first == j);
  }
  for (int l = 1;
       l <= min((int)s[0].size(), min((int)s[1].size(), (int)s[2].size()));
       l++) {
    for (int i = 0; i < adj[l - 1].size(); i++) {
      int pos = adj[l - 1][i];
      update(pos);
    }
    cout << ans % mod << " ";
  }
  cout << endl;
  return 0;
}
