#include <bits/stdc++.h>
using namespace std;
int tp[1000514], box[1000514];
void radix_sort(int* sa, int* ra, int n, int m, int l) {
  for (int i = n - l; i < n; i++) tp[i - (n - l)] = i;
  box[0] = l;
  for (int i = 1; i <= m; i++) box[i] = 0;
  for (int i = 0; i < n - l; i++) box[ra[i + l]]++;
  for (int i = 1; i <= m; i++) box[i] += box[i - 1];
  for (int i = n - l - 1; i >= 0; i--) tp[--box[ra[i + l]]] = i;
  for (int i = 0; i <= m; i++) box[i] = 0;
  for (int i = 0; i < n; i++) box[ra[i]]++;
  for (int i = 1; i <= m; i++) box[i] += box[i - 1];
  for (int i = n - 1; i >= 0; i--) sa[--box[ra[tp[i]]]] = tp[i];
}
int equ(int* ra, int a, int b, int l) {
  return ra[a] == ra[b] && ra[a + l] == ra[b + l];
}
void make_sa(int* sa, int* ra, char* s, int l) {
  int m = 256;
  for (int i = 0; i < l; i++) ra[i] = s[i];
  radix_sort(sa, ra, l, m, 0);
  for (int rl = 1; rl < l; rl *= 2) {
    radix_sort(sa, ra, l, m, rl);
    tp[sa[0]] = 0;
    m = 1;
    for (int i = 1; i < l; i++)
      tp[sa[i]] = equ(ra, sa[i], sa[i - 1], rl) ? m - 1 : m++;
    for (int i = 0; i < l; i++) ra[i] = tp[i];
    if (m == l) break;
  }
  for (int i = 0; i < l; i++) ra[sa[i]] = i;
}
void make_he(int* he, char* s, int l, int* sa, int* ra) {
  int k = 0;
  for (int i = 0; i < l; i++) {
    if (ra[i] == 0) {
      k = he[0] = 0;
      continue;
    }
    k = std::max(0, k - 1);
    for (; s[i + k] == s[sa[ra[i] - 1] + k]; k++)
      ;
    he[ra[i]] = k;
  }
}
char s[300514];
int l1, l2, l3;
int sa[300514];
int ra[300514];
int he[300514];
int sth[300514];
int stx[300514];
int stc[300514][3];
int top;
int bs(int x) {
  if (0 <= x && x < l1) {
    return 0;
  } else if (l1 + 1 <= x && x < l1 + 1 + l2) {
    return 1;
  } else if (l1 + 1 + l2 + 1 <= x && x < l1 + 1 + l2 + 1 + l3) {
    return 2;
  }
  puts("jizz");
  return 7122;
}
int a[300514];
int mod = 1000000007;
void go(int ax, int hl, int hh, int* c) {
  c[bs(sa[ax])]++;
  a[hl + 1] = (a[hl + 1] + 000 + 1ll * c[0] * c[1] % mod * c[2] % mod) % mod;
  a[hh + 1] = (a[hh + 1] + mod - 1ll * c[0] * c[1] % mod * c[2] % mod) % mod;
  c[bs(sa[ax])]--;
}
int main() {
  scanf("%s", s);
  for (; s[l1]; l1++)
    ;
  s[l1] = 2;
  scanf("%s", s + l1 + 1);
  for (; s[l1 + 1 + l2]; l2++)
    ;
  s[l1 + 1 + l2] = 1;
  scanf("%s", s + l1 + 1 + l2 + 1);
  for (; s[l1 + 1 + l2 + 1 + l3]; l3++)
    ;
  s[l1 + 1 + l2 + 1 + l3] = 0;
  s[l1 + l2 + l3 + 3] = 0;
  make_sa(sa, ra, s, l1 + l2 + l3 + 3);
  make_he(he, s, l1 + l2 + l3 + 3, sa, ra);
  he[l1 + l2 + l3 + 3] = 0;
  top = 0;
  sth[top++] = 0;
  for (int i = 4; i <= l1 + l2 + l3 + 3; i++) {
    int ax = i - 1;
    int tt[3] = {0, 0, 0};
    for (; sth[top - 1] > he[i];) {
      if (sth[top - 2] >= he[i]) {
        go(stx[top - 1], sth[top - 2], sth[top - 1], stc[top - 1]);
        stc[top - 2][0] += stc[top - 1][0];
        stc[top - 2][1] += stc[top - 1][1];
        stc[top - 2][2] += stc[top - 1][2];
        top--;
      } else if (sth[top - 2] < he[i]) {
        go(stx[top - 1], he[i], sth[top - 1], stc[top - 1]);
        ax = stx[top - 1];
        tt[0] += stc[top - 1][0];
        tt[1] += stc[top - 1][1];
        tt[2] += stc[top - 1][2];
        top--;
      } else {
        puts("jizz");
        break;
      }
    }
    if (sth[top - 1] == he[i]) {
      stc[top - 1][bs(sa[i])]++;
    } else {
      stx[top] = ax;
      sth[top] = he[i];
      stc[top][0] = tt[0];
      stc[top][1] = tt[1];
      stc[top][2] = tt[2];
      stc[top][bs(sa[i])]++;
      top++;
    }
  }
  int ll = min(min(l1, l2), l3);
  for (int i = 1; i <= ll; i++) {
    a[i] = (a[i] + a[i - 1]) % mod;
    printf("%d\n", a[i]);
  }
  return 0;
}
