#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
const int MM = 998244353;
const long double PI = acos(-1);
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  return os << '(' << p.first << "," << p.second << ')';
}
const int MOD = 1000000007;
struct Mint {
  int val;
  Mint(long long v = 0) {
    if (v < 0) v = v % MOD + MOD;
    if (v >= MOD) v %= MOD;
    val = v;
  }
  static int mod_inv(int a, int m = MOD) {
    int g = m, r = a, x = 0, y = 1;
    while (r != 0) {
      int q = g / r;
      g %= r;
      swap(g, r);
      x -= q * y;
      swap(x, y);
    }
    return x < 0 ? x + m : x;
  }
  explicit operator int() const { return val; }
  Mint &operator+=(const Mint &other) {
    val += other.val;
    if (val >= MOD) val -= MOD;
    return *this;
  }
  Mint &operator-=(const Mint &other) {
    val -= other.val;
    if (val < 0) val += MOD;
    return *this;
  }
  static unsigned fast_mod(uint64_t x, unsigned m = MOD) {
    return x % m;
    unsigned x_high = x >> 32, x_low = (unsigned)x;
    unsigned quot, rem;
    asm("divl %4\n" : "=a"(quot), "=d"(rem) : "d"(x_high), "a"(x_low), "r"(m));
    return rem;
  }
  Mint &operator*=(const Mint &other) {
    val = fast_mod((uint64_t)val * other.val);
    return *this;
  }
  Mint &operator/=(const Mint &other) { return *this *= other.inv(); }
  friend Mint operator+(const Mint &a, const Mint &b) { return Mint(a) += b; }
  friend Mint operator-(const Mint &a, const Mint &b) { return Mint(a) -= b; }
  friend Mint operator*(const Mint &a, const Mint &b) { return Mint(a) *= b; }
  friend Mint operator/(const Mint &a, const Mint &b) { return Mint(a) /= b; }
  Mint &operator++() {
    val = val == MOD - 1 ? 0 : val + 1;
    return *this;
  }
  Mint &operator--() {
    val = val == 0 ? MOD - 1 : val - 1;
    return *this;
  }
  Mint operator++(int32_t) {
    Mint before = *this;
    ++*this;
    return before;
  }
  Mint operator--(int32_t) {
    Mint before = *this;
    --*this;
    return before;
  }
  Mint operator-() const { return val == 0 ? 0 : MOD - val; }
  bool operator==(const Mint &other) const { return val == other.val; }
  bool operator!=(const Mint &other) const { return val != other.val; }
  Mint inv() const { return mod_inv(val); }
  Mint power(long long p) const {
    assert(p >= 0);
    Mint a = *this, result = 1;
    while (p > 0) {
      if (p & 1) result *= a;
      a *= a;
      p >>= 1;
    }
    return result;
  }
  friend ostream &operator<<(ostream &stream, const Mint &m) {
    return stream << m.val;
  }
  friend istream &operator>>(istream &stream, Mint &m) {
    return stream >> m.val;
  }
};
const int LEN = 600005;
struct SA {
  struct state {
    int len, link;
    map<char, int> next;
  };
  state st[LEN];
  int sz, last;
  Mint cnt[LEN][3];
  bitset<LEN> vis;
  void SA_make() {
    sz = 0;
    st[0].len = 0, st[0].link = -1;
    ++sz;
    last = 0;
  }
  SA() { SA_make(); }
  void add(char c, int i) {
    int new_n = sz++;
    st[new_n].len = st[last].len + 1;
    int pt = last;
    while (pt != -1 && !st[pt].next.count(c)) {
      st[pt].next[c] = new_n;
      pt = st[pt].link;
    }
    if (pt == -1) {
      st[new_n].link = 0;
    } else {
      int q_st = st[pt].next[c];
      if (st[q_st].len == st[pt].len + 1)
        st[new_n].link = q_st;
      else {
        int clone = sz++;
        st[clone] = st[q_st];
        st[clone].len = st[pt].len + 1;
        st[q_st].link = st[new_n].link = clone;
        while (pt != -1 && st[pt].next[c] == q_st) {
          st[pt].next[c] = clone;
          pt = st[pt].link;
        }
      }
    }
    last = new_n;
    ++cnt[last][i];
  }
  int minlen(int u) {
    if (u == 0) return 0;
    return st[st[u].link].len + 1;
  }
  void addCount() {
    vector<int> v;
    for (int i = 1; i < sz; ++i) v.push_back(i);
    sort(v.begin(), v.end(),
         [&](int x, int y) { return st[x].len > st[y].len; });
    for (int i = 0; i < sz - 1; ++i) {
      for (int j = 0; j < 3; ++j) cnt[st[v[i]].link][j] += cnt[v[i]][j];
    }
  }
} sa;
Mint ans[LEN];
void dfs(int s) {
  if (sa.vis[s]) return;
  sa.vis[s] = 1;
  if (s) {
    Mint u = sa.cnt[s][0] * sa.cnt[s][1] * sa.cnt[s][2];
    ans[sa.st[sa.st[s].link].len + 1] += u;
    ans[sa.st[s].len + 1] -= u;
  }
  for (auto j : sa.st[s].next) {
    dfs(j.second);
  }
}
int _runtimeTerror_() {
  string a, b, c;
  cin >> a >> b >> c;
  for (auto j : a) sa.add(j, 0);
  sa.add('#', 0);
  for (auto j : b) sa.add(j, 1);
  sa.add('$', 1);
  for (auto j : c) sa.add(j, 2);
  sa.addCount();
  dfs(0);
  Mint sum = 0;
  int len =
      min({(long long)a.size(), (long long)b.size(), (long long)c.size()});
  for (int i = 1; i <= len; ++i) {
    sum += ans[i];
    cout << sum << " ";
  }
  cout << "\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) _runtimeTerror_();
  return 0;
}
