#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
struct State {
  State *suf, *go[30];
  int val;
  ;
  long long right[3];
  State() : suf(0), val(0) { memset(go, 0, sizeof(go)); }
} * root, *last;
State statePool[610000], *cur;
void init() {
  cur = statePool;
  root = last = cur++;
}
void extend(int w) {
  State *p = last, *np = cur++;
  np->val = p->val + 1;
  while (p && !p->go[w]) p->go[w] = np, p = p->suf;
  if (!p)
    np->suf = root;
  else {
    State *q = p->go[w];
    if (p->val + 1 == q->val)
      np->suf = q;
    else {
      State *nq = cur++;
      memcpy(nq->go, q->go, sizeof q->go);
      nq->val = p->val + 1;
      nq->suf = q->suf;
      q->suf = nq;
      np->suf = nq;
      while (p && p->go[w] == q) {
        p->go[w] = nq, p = p->suf;
      }
    }
  }
  last = np;
}
char str[610000];
int n;
bool vis[610000];
void dfs(State *u) {
  if (vis[u - statePool]) return;
  if (!vis[u - statePool]) {
    vis[u - statePool] = true;
    for (int i = 0; i < 3; i++) {
      if (u->go[26 + i]) u->right[i] = 1;
    }
    for (int i = 0; i < 26; i++) {
      if (u->go[i]) {
        dfs(u->go[i]);
        for (int k = 0; k < 3; k++) {
          u->right[k] = (u->right[k] + u->go[i]->right[k]) % 1000000007;
        }
      }
    }
  }
}
long long num[610000];
int main() {
  init();
  int n = 1e8;
  scanf("%s", str);
  n = min(n, int(strlen(str)));
  for (int i = 0; str[i]; i++) extend(str[i] - 'a');
  extend(26);
  scanf("%s", str);
  n = min(n, int(strlen(str)));
  for (int i = 0; str[i]; i++) extend(str[i] - 'a');
  extend(27);
  scanf("%s", str);
  n = min(n, int(strlen(str)));
  for (int i = 0; str[i]; i++) extend(str[i] - 'a');
  extend(28);
  dfs(root);
  int tot = cur - statePool;
  for (int i = 1; i < tot; i++) {
    State *u = &statePool[i];
    long long tmp = u->right[0] % 1000000007 * u->right[1] % 1000000007 *
                    u->right[2] % 1000000007;
    num[u->val] = (num[u->val] + tmp) % 1000000007;
    num[u->suf->val] =
        ((num[u->suf->val] - tmp) % 1000000007 + 1000000007) % 1000000007;
  }
  for (int i = tot - 2; i >= 1; i--) {
    num[i] = (num[i] + num[i + 1]) % 1000000007;
  }
  for (int i = 1; i <= n; i++) {
    if (i > 1) printf(" ");
    printf("%I64d", num[i]);
  }
  puts("");
}
