#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
int main() {
  string s, t;
  cin >> s >> t;
  const int n = s.size();
  const int m = t.size();
  int p = 0;
  vector<int> cur(n + 1, INF), nxt(n + 1, INF);
  cur[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= n; j++) {
      nxt[j] = min(nxt[j], cur[j] + 1);
      if (j < n && s[i] == t[j % m]) {
        nxt[j + 1] = min(nxt[j + 1], cur[j]);
      }
      nxt[j / m * m] = min(nxt[j / m * m], cur[j]);
    }
    cur.swap(nxt);
    fill(nxt.begin(), nxt.end(), INF);
  }
  for (int x = 0; x <= n; x++) {
    int res = 0;
    for (int i = 0; i <= n; i++) {
      if (cur[i] <= x) {
        res =
            max(res, max(0, (i - max(0, (x - cur[i]) - (n - i - cur[i]))) / m));
      }
    }
    cout << res << " \n"[x == n];
  }
}
