#include <bits/stdc++.h>
using namespace std;
struct state {
  int len, link;
  map<char, int> next;
};
state st[1000005];
int sz, last;
long long MOD = 1e9 + 7;
void sa_init() {
  last = st[0].len = 0;
  sz = 1;
  st[0].link = -1;
}
void sa_extend(char c) {
  int k = sz++, p;
  st[k].len = st[last].len + 1;
  for (p = last; p != -1 && !st[p].next.count(c); p = st[p].link)
    st[p].next[c] = k;
  if (p == -1)
    st[k].link = 0;
  else {
    int q = st[p].next[c];
    if (st[p].len + 1 == st[q].len)
      st[k].link = q;
    else {
      int w = sz++;
      st[w].len = st[p].len + 1;
      st[w].next = st[q].next;
      st[w].link = st[q].link;
      for (; p != -1 && st[p].next[c] == q; p = st[p].link) st[p].next[c] = w;
      st[q].link = st[k].link = w;
    }
  }
  last = k;
}
int dp1[1000005], dp2[1000005], dp3[1000005];
long long w1[1000005], w2[1000005], w3[1000005];
long long ways(int pos, char now, char good, long long *way) {
  long long &r = way[pos];
  if (r >= 0) return r;
  if (now == good) return r = 1;
  r = 0;
  if ((now >= 'a' && now <= 'z') || pos == 0) {
    for (auto x : st[pos].next) {
      r += ways(x.second, x.first, good, way);
    }
  }
  return r;
}
long long ans[1000050];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  sa_init();
  string s, t, v;
  cin >> s >> t >> v;
  string tot = s + "$" + t + "#" + v + "%";
  for (auto x : tot) sa_extend(x);
  memset(dp1, -1, sizeof(dp1));
  memset(dp2, -1, sizeof(dp2));
  memset(dp3, -1, sizeof(dp3));
  memset(w1, -1, sizeof(w1));
  memset(w2, -1, sizeof(w2));
  memset(w3, -1, sizeof(w3));
  ways(0, '.', '$', w1);
  ways(0, '.', '#', w2);
  ways(0, '.', '%', w3);
  for (int i = 1, ThxDem = last + 1; i < ThxDem; ++i) {
    if (w1[i] > 0 && w2[i] > 0 && w3[i] > 0) {
      long long val = w1[i] * w2[i] % MOD * w3[i] % MOD;
      ans[st[st[i].link].len + 1] += val;
      ans[st[st[i].link].len + 1] %= MOD;
      ans[st[i].len + 1] -= val;
      ans[st[i].len + 1] += MOD;
      ans[st[i].len + 1] %= MOD;
    }
  }
  long long now = 0;
  for (int i = 1, ThxDem = min({((int)(s).size()), ((int)(t).size()),
                                ((int)(v).size())}) +
                           1;
       i < ThxDem; ++i) {
    now = (now + ans[i] + MOD) % MOD;
    cout << now << " ";
  }
  cout << endl;
}
