#include <bits/stdc++.h>
using namespace std;
inline char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
template <class T>
inline void read(T& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x);
  read(y);
  read(z);
}
template <class T>
inline void read(T& x, T& y, T& z, T& q) {
  read(x);
  read(y);
  read(z);
  read(q);
}
const int N = 1000010;
const int mod = 1000000007;
char a[N], ss[N];
int ki[N], sa[N], sa2[N], RANK[N], RANK2[N], h[N], sum[N];
int cnt[N][4];
pair<int, int> H[N][19];
int two[N];
long long s[N];
int n, i, j, k, l, p;
void suffix() {
  int i, j, p;
  for (i = 1; i <= n; i++) sum[a[i]]++;
  for (i = 1; i <= 128; i++) sum[i] += sum[i - 1];
  for (i = n; i >= 1; i--) sa[sum[a[i]]--] = i;
  j = RANK[sa[1]] = 1;
  for (i = 2; i <= n; i++) {
    if (a[sa[i]] != a[sa[i - 1]]) j++;
    RANK[sa[i]] = j;
  }
  for (p = 1; j < n; p *= 2) {
    memcpy(RANK2, RANK, sizeof(RANK));
    memset(sum, 0, sizeof(sum));
    j = 0;
    for (i = n - p + 1; i <= n; i++) sa2[++j] = i;
    for (i = 1; i <= n; i++)
      if (sa[i] > p) sa2[++j] = sa[i] - p;
    for (i = 1; i <= n; i++) sum[RANK[sa2[i]]]++;
    for (i = 1; i <= n; i++) sum[i] += sum[i - 1];
    for (i = n; i >= 1; i--) sa[sum[RANK[sa2[i]]]--] = sa2[i];
    j = RANK[sa[1]] = 1;
    for (i = 2; i <= n; i++) {
      if (RANK2[sa[i]] != RANK2[sa[i - 1]] ||
          RANK2[sa[i] + p] != RANK2[sa[i - 1] + p])
        ++j;
      RANK[sa[i]] = j;
    }
  }
  p = 0;
  for (i = 1; i <= n; i++)
    if (RANK[i] > 1) {
      j = sa[RANK[i] - 1];
      while (a[i + p] == a[j + p]) p++;
      h[RANK[i]] = p;
      if (p) p--;
    }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= 3; j++) cnt[i][j] = cnt[i - 1][j] + (ki[sa[i]] == j);
  for (i = n; i >= 1; i--) {
    H[i][0] = make_pair(h[i], i);
    for (k = 1; k <= 18; k++)
      if (i + (1 << k) - 1 <= n)
        H[i][k] = min(H[i][k - 1], H[i + (1 << (k - 1))][k - 1]);
  }
  for (i = 2; i <= n; i++) two[i] = two[i / 2] + 1;
}
pair<int, int> get(int l, int r) {
  l++;
  int t = two[r - l + 1];
  return min(H[l][t], H[r - (1 << t) + 1][t]);
}
int gs(int t, int l, int r) { return cnt[r][t] - cnt[l - 1][t]; }
void work(int l, int r) {
  if (l >= r) return;
  pair<int, int> u = get(l, r);
  int i, j;
  long long s1, s2, tot = 0;
  for (i = 1; i <= 3; i++) {
    s1 = s2 = 1;
    for (j = 1; j <= 3; j++)
      if (i == j)
        s1 *= gs(j, l, u.second - 1);
      else
        s2 *= gs(j, u.second, r);
    tot = (tot + s1 % mod * (s2 % mod)) % mod;
    s1 = s2 = 1;
    for (j = 1; j <= 3; j++)
      if (i == j)
        s1 *= gs(j, u.second, r);
      else
        s2 *= gs(j, l, u.second - 1);
    tot = (tot + s1 % mod * (s2 % mod)) % mod;
  }
  s[u.first] = ((s[u.first]) + (tot)) % mod;
  work(l, u.second - 1);
  work(u.second, r);
}
int main() {
  int ml = int(1e9);
  for (p = 1; p <= 3; p++) {
    scanf("%s", ss + 1);
    l = strlen(ss + 1);
    for (i = 1; i <= l; i++) a[++n] = ss[i], ki[n] = p;
    a[++n] = p + 'A';
    ml = min(ml, l);
  }
  suffix();
  work(1, n);
  for (i = ml; i >= 1; i--) s[i] = ((s[i]) + (s[i + 1])) % mod;
  for (i = 1; i <= ml; i++) s[i] = (s[i] + mod) % mod;
  for (i = 1; i <= ml; i++) printf("%d ", int(s[i]));
  printf("\n");
  scanf("\n");
  return 0;
}
