#include <bits/stdc++.h>
using namespace std;
string s, p;
int i, j, k, A[100001], d[6001][6001];
int main() {
  cin >> s >> p;
  for (i = 0; i < s.length(); i++) {
    k = 0;
    for (j = 0; j < p.size(); j++, k++) {
      while (k < s.length() && s[i + k] != p[j]) k++;
    };
    k--;
    A[i] = k;
  }
  for (i = 0; i < s.length(); i++)
    for (j = 0; j <= i; j++) {
      d[i + 1][j] = max(d[i + 1][j], d[i][j]);
      d[i + 1][j + 1] = max(d[i + 1][j + 1], d[i][j]);
      if (A[i] != s.length() + 1)
        d[i + A[i] + 1][j + A[i] - p.size() + 1] =
            max(d[i + A[i] + 1][j + A[i] - p.size() + 1], d[i][j] + 1);
    }
  for (i = 0; i <= s.length(); i++) cout << d[s.length()][i] << " ";
  return 0;
}
