#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5, mod = 1e9 + 7;
struct node {
  map<char, int> edges;
  int link = -1;
  int lenght = 0;
};
vector<node> SA;
int last = 0;
void buildSA(string s) {
  SA.push_back(node());
  for (int i = 0; i < s.size(); i++) {
    SA.push_back(node());
    int r = SA.size() - 1;
    SA[r].lenght = i + 1;
    SA[r].link = 0;
    int p = last;
    while (p >= 0 && SA[p].edges.find(s[i]) == SA[p].edges.end()) {
      SA[p].edges[s[i]] = r;
      p = SA[p].link;
    }
    if (p != -1) {
      int q = SA[p].edges[s[i]];
      if (SA[p].lenght + 1 == SA[q].lenght)
        SA[r].link = q;
      else {
        SA.push_back(node());
        int qq = SA.size() - 1;
        SA[qq].edges = SA[q].edges;
        SA[qq].lenght = SA[p].lenght + 1;
        SA[qq].link = SA[q].link;
        SA[q].link = qq;
        SA[r].link = qq;
        while (p >= 0 && SA[p].edges[s[i]] == q) {
          SA[p].edges[s[i]] = qq;
          p = SA[p].link;
        }
      }
    }
    last = r;
  }
}
bool cmp(int a, int b) { return SA[a].lenght < SA[b].lenght; }
int dp[2 * MAXN][3];
long long mx[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string a, b, c;
  cin >> a >> b >> c;
  string x = a + "#" + b + "$" + c + "%";
  buildSA(x);
  vector<int> TopSort;
  for (int i = 0; i < SA.size(); i++) TopSort.push_back(i);
  sort(TopSort.begin(), TopSort.end(), cmp);
  for (int i = TopSort.size() - 1; i >= 0; i--) {
    int cur = TopSort[i];
    for (auto it : SA[cur].edges) {
      int edge = it.first;
      int adj = it.second;
      if (edge == '%')
        dp[cur][2] += 1;
      else if (edge == '$')
        dp[cur][1] += dp[adj][2];
      else if (edge == '#')
        dp[cur][0] += dp[adj][1];
      else {
        dp[cur][0] += dp[adj][0];
        dp[cur][1] += dp[adj][1];
        dp[cur][2] += dp[adj][2];
      }
    }
    if (cur != 0) {
      int l2 = SA[cur].lenght;
      int l1 = SA[SA[cur].link].lenght;
      long long temp = (1LL * dp[cur][0] * dp[cur][1] * dp[cur][2]) % mod;
      mx[l1] = (mx[l1] + temp) % mod;
      mx[l2] = (mx[l2] - temp + mod) % mod;
    }
  }
  long long ans = mx[0] % mod;
  cout << ans;
  for (int i = 1; i < min(a.size(), min(b.size(), c.size())); i++) {
    ans = (ans + mx[i]) % mod;
    cout << " " << ans;
  }
  return 0;
}
