#include <bits/stdc++.h>
using namespace std;
struct state {
  int len, link;
  map<char, int> next;
};
state node[2 * 1000000 + 5];
int sz, last;
long long cnt[3][2 * 1000000 + 5];
long long mark[2 * 1000000 + 5] = {0};
vector<pair<int, int> > vt;
inline void init() {
  sz = last = 0;
  node[0].len = 0;
  node[0].link = -1;
  ++sz;
  memset((cnt), (0ll), sizeof((cnt)));
  ;
}
inline void Insert(char c, int id) {
  int cur = sz++;
  node[cur].len = node[last].len + 1;
  int p;
  for (p = last; p != -1 && !node[p].next.count(c); p = node[p].link)
    node[p].next[c] = cur;
  if (p == -1) {
    node[cur].link = 0;
  } else {
    int q = node[p].next[c];
    if (node[p].len + 1 == node[q].len) {
      node[cur].link = q;
    } else {
      int clone = sz++;
      node[clone].len = node[p].len + 1;
      node[clone].next = node[q].next;
      node[clone].link = node[q].link;
      for (; p != -1 && node[p].next[c] == q; p = node[p].link)
        node[p].next[c] = clone;
      node[q].link = node[cur].link = clone;
      vt.push_back(make_pair(node[clone].len, clone));
    }
  }
  cnt[id][cur] = 1ll;
  vt.push_back(make_pair(node[cur].len, cur));
  last = cur;
  return;
}
char s[1000000 + 5];
vector<int> in[1000000 + 5];
vector<int> out[1000000 + 5];
char arr[3] = {'#', '*', '$'};
int main() {
  init();
  int len = 1000000007;
  for (int j = 0; j < 3; j++) {
    scanf("%s", s);
    int n = strlen(s);
    len = min(n, len);
    for (int i = 0; i < n; i++) {
      Insert(s[i], j);
    }
    Insert(arr[j], j);
  }
  sort(vt.rbegin(), vt.rend());
  mark[last] = 1;
  for (pair<int, int> x : vt) {
    for (int i = 0; i < 3; i++) {
      cnt[i][node[x.second].link] += cnt[i][x.second];
      cnt[i][node[x.second].link] %= 1000000007;
    }
    int len1 = node[x.second].len;
    int len2 = node[node[x.second].link].len + 1;
    in[len2].push_back(x.second);
    out[len1].push_back(x.second);
  }
  long long tem = 0ll;
  long long ans[len + 5];
  for (int i = 1; i <= len; i++) {
    for (int j : in[i]) {
      tem +=
          ((((cnt[0][j] * cnt[1][j]) % 1000000007) * cnt[2][j]) % 1000000007);
      tem %= 1000000007;
    }
    ans[i] = tem;
    for (int j : out[i]) {
      tem -=
          ((((cnt[0][j] * cnt[1][j]) % 1000000007) * cnt[2][j]) % 1000000007);
      tem = (tem + 1000000007) % 1000000007;
    }
  }
  for (int i = 1; i <= len; i++) {
    if (i != 1) printf(" ");
    printf("%lld", ans[i]);
  }
  return 0;
}
