#include <bits/stdc++.h>
using namespace std;
int next() {
  int x;
  cin >> x;
  return x;
}
long long nextl() {
  long long x;
  cin >> x;
  return x;
}
double nextd() {
  double x;
  cin >> x;
  return x;
}
void out(long long x) { printf("%d ", x); }
void outln(long long x) { printf("%d\n", x); }
void outln() { printf("\n"); };
int main() {
  string s;
  string p;
  cin >> s;
  cin >> p;
  int n = s.length();
  int k = p.length();
  int next[n];
  for (int i = 0; i < n; i++) next[i] = -1;
  vector<pair<int, int> > pr;
  for (int i = 0; i < n; i++)
    if (s[i] == p[0]) {
      int start;
      int j;
      for (j = 0, start = i; j < k && start < n; start++)
        if (p[j] == s[start]) j++;
      if (j == k) pr.push_back((make_pair((i), (start))));
    }
  for (int i = 0; i < pr.size(); i++) next[pr[i].first] = pr[i].second;
  int mn[n + 1][n + 1];
  int inf = 1000000;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++) mn[i][j] = inf;
  mn[0][0] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      mn[i + 1][j] = min(mn[i + 1][j], mn[i][j]);
      if (next[i] >= 0)
        mn[next[i]][j + 1] =
            min(mn[next[i]][j + 1], mn[i][j] + next[i] - i - k);
    }
  int best[n + 1];
  for (int i = 0; i <= n; i++) best[i] = 0;
  for (int i = 1; i <= n; i++)
    if (mn[n][i] < inf)
      for (int j = mn[n][i]; j <= n - i * k; j++) best[j] = i;
  for (int i = 0; i <= n; i++) out(best[i]);
  outln();
}
