#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int MAXC = 6e5 + 10;
struct state {
  int len, link, pos;
  map<int, int> next;
};
state st[MAXC];
int sz, last;
void sa_init() {
  last = st[0].len = 0;
  sz = 1;
  st[0].link = -1;
}
void sa_extend(int c, int pos) {
  int k = sz++, p;
  st[k].len = st[last].len + 1;
  st[k].pos = pos;
  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].pos = st[q].pos;
      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;
}
long long add(long long a, long long b) {
  if (a >= MOD) a %= MOD;
  if (b >= MOD) b %= MOD;
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
long long sub(long long a, long long b) {
  if (a >= MOD) a %= MOD;
  if (b >= MOD) b %= MOD;
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
long long mult(long long a, long long b) {
  if (a >= MOD) a %= MOD;
  if (b >= MOD) b %= MOD;
  return (a * b) % MOD;
}
long long dp[4][MAXC], ans[MAXC];
bool vis[MAXC];
long long dfs(int u, long long *dp, int v) {
  if (dp[u] != -1) return dp[u];
  dp[u] = 0;
  for (auto p : st[u].next) {
    if (p.first >= 0)
      dp[u] = add(dp[u], dfs(p.second, dp, v));
    else if (v == -p.first)
      dp[u] = add(dp[u], 1);
  }
  return dp[u];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset((dp), (-1), sizeof(dp));
  int cs = 0, sz_s0 = 0, mnsz = 1e9;
  sa_init();
  for (int x = (0), qwerty = (3); x < qwerty; x++) {
    string s;
    cin >> s;
    for (char c : s) sa_extend(c - 'a', cs++);
    sa_extend(-x - 1, cs++);
    if (x == 0) sz_s0 = int((s).size());
    mnsz = min(mnsz, int((s).size()));
  }
  for (int i = (1), qwerty = (4); i < qwerty; i++) dfs(0, dp[i], i);
  for (int x = (1), qwerty = (sz); x < qwerty; x++)
    if (st[x].pos < sz_s0) {
      int mnl = st[st[x].link].len + 1, mxl = st[x].len;
      long long tmp = mult(dp[1][x], mult(dp[2][x], dp[3][x]));
      ans[mnl] = add(ans[mnl], tmp);
      ans[mxl + 1] = sub(ans[mxl + 1], tmp);
    }
  for (int x = (1), qwerty = (mnsz + 1); x < qwerty; x++)
    ans[x] = add(ans[x], ans[x - 1]), cout << ans[x] << " \n"[x == mnsz];
}
