#include <bits/stdc++.h>
using namespace std;
void task();
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  task();
  return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 9e5 + 10;
const int M = 1e5 + 10;
const long long int MOD = 1e9 + 7;
struct SA {
  struct State {
    int len;
    int link;
    map<char, int> next;
    long long int cnt[3];
    State() : len(0), link(-1) { memset(cnt, 0, sizeof(cnt)); };
  };
  State st[2 * N];
  int sz = 1;
  int last = 0;
  void push(char ch, int id) {
    int cur = sz++;
    st[cur].len = st[last].len + 1;
    if (id != -1) st[cur].cnt[id] = 1;
    int p = last;
    last = cur;
    for (; p != -1 && !st[p].next.count(ch); p = st[p].link)
      st[p].next[ch] = cur;
    if (p == -1) {
      st[cur].link = 0;
      return;
    }
    int q = st[p].next[ch];
    if (st[p].len + 1 == st[q].len) {
      st[cur].link = q;
      return;
    }
    int clone = sz++;
    st[clone].next = st[q].next;
    st[clone].link = st[q].link;
    st[clone].len = st[p].len + 1;
    st[q].link = st[cur].link = clone;
    for (; p != -1 && st[p].next.count(ch) && st[p].next[ch] == q;
         p = st[p].link)
      st[p].next[ch] = clone;
  }
  void calc() {
    vector<pair<int, int> > v;
    for (int i = 1; i < sz; ++i) v.push_back(pair<int, int>{st[i].len, i});
    sort((v.begin()), (v.end()));
    reverse((v.begin()), (v.end()));
    for (pair<int, int> p : v)
      for (int i = 0; i < 3; ++i) {
        st[st[p.second].link].cnt[i] += st[p.second].cnt[i];
      }
  }
  vector<long long> solve(int n) {
    vector<long long> add(n + 1, 0);
    vector<long long> ans(n, 0);
    for (int i = 1; i < sz; ++i) {
      if (st[i].cnt[0] && st[i].cnt[1] && st[i].cnt[2]) {
        long long int cnt =
            st[i].cnt[0] * st[i].cnt[1] % MOD * st[i].cnt[2] % MOD;
        int mx = st[i].len;
        int mn = st[st[i].link].len;
        add[mn] = (add[mn] + cnt) % MOD;
        add[mx] = (add[mx] + MOD - cnt) % MOD;
      }
    }
    long long int cur = 0;
    for (int i = 0; i < n; ++i) {
      cur = (cur + add[i]) % MOD;
      ans[i] = cur;
    }
    return ans;
  }
};
SA sa;
string s;
void task() {
  int n = 1e9;
  for (int i = 0; i < 3; ++i) {
    cin >> s;
    n = min(n, (int)s.length());
    for (int j = 0; j < s.length(); ++j) sa.push(s[j], i);
    sa.push('A' + i, -1);
  }
  sa.calc();
  vector<long long> ans = sa.solve(n);
  for (long long int x : ans) cout << x << ' ';
}
