#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 555;
const int V = N * 2;
int mod = 1e9 + 7;
int len[V], ololink[V], to[V][28];
int code(int c) {
  if (c == '$') return 0;
  if (c == '#') return 1;
  return c - 'a' + 2;
}
char s1[N];
char s2[N];
char s3[N];
char s[N];
int pos[V][3];
int cnt[V][3];
vector<int> v[N];
long long z[N];
int main() {
  int n, m;
  int n1, n2, n3;
  gets(s1);
  gets(s2);
  gets(s3);
  m = min(strlen(s1), strlen(s2));
  m = min(m, (int)strlen(s3));
  strcat(s, s1);
  n1 = strlen(s);
  strcat(s, "$");
  strcat(s, s2);
  n2 = strlen(s);
  strcat(s, "#");
  strcat(s, s3);
  n3 = strlen(s);
  n = strlen(s);
  memset(pos, -1, sizeof pos);
  int d = 0;
  int l = d++;
  ololink[l] = -1;
  for (int i = 0; i < n; ++i) {
    int c = code(s[i]);
    int x = d++;
    len[x] = len[l] + 1;
    if (i < n1)
      pos[x][0] = i, cnt[x][0] = 1;
    else if (i < n2)
      pos[x][1] = i, cnt[x][1] = 1;
    else if (i < n3)
      pos[x][2] = i, cnt[x][2] = 1;
    for (; l != -1 && !to[l][c]; l = ololink[l]) to[l][c] = x;
    if (l != -1) {
      int p = to[l][c];
      if (len[p] == len[l] + 1)
        ololink[x] = p;
      else {
        int q = d++;
        memcpy(to[q], to[p], sizeof(to[q]));
        len[q] = len[l] + 1;
        ololink[q] = ololink[p];
        for (; l != -1 && to[l][c] == p; l = ololink[l]) to[l][c] = q;
        ololink[x] = ololink[p] = q;
      }
    }
    l = x;
  }
  for (int i = 0; i < d; ++i) v[len[i]].push_back(i);
  for (int l = n; l; --l)
    for (int k = 0; k < v[l].size(); ++k) {
      int i = v[l][k];
      int j = ololink[i];
      bool good = true;
      ;
      for (int b = 0; b < 3; ++b) {
        if (pos[i][b] != -1) {
          pos[j][b] = max(pos[j][b], pos[i][b]);
          cnt[j][b] += cnt[i][b];
        }
        if (pos[i][b] != -1) {
          if (b == 0)
            good &= (pos[i][b] - len[i] + 1 >= 0);
          else if (b == 1)
            good &= (pos[i][b] - len[i] + 1 > n1);
          else if (b == 3)
            good &= (pos[i][b] - len[i] + 1 > n2);
        } else
          good = false;
      }
      if (good) {
        long long c = cnt[i][0];
        c = c * cnt[i][1] % mod;
        c = c * cnt[i][2] % mod;
        z[len[j] + 1] = (z[len[j] + 1] + c) % mod;
        z[len[i] + 1] = (z[len[i] + 1] - c + mod) % mod;
      }
    }
  for (int i = 1; i <= m; ++i) {
    z[i] = (z[i] + z[i - 1]) % mod;
    printf("%d ", (int)z[i]);
  }
  return 0;
}
