#include <bits/stdc++.h>
using namespace std;
const int maxn = 2010;
char s[maxn], t[maxn];
int d[maxn][maxn], n, m, inf = 1e8;
pair<int, int> gao(int i) {
  int p = 1, pre = i;
  for (; i <= n; i++)
    if (s[i] == t[p]) {
      if (p == 1) pre = i;
      if (p == m) return make_pair(i - pre + 1, i);
      p++;
    }
  return make_pair(inf, n + 1);
}
int main() {
  int ans = 0;
  cin >> s + 1;
  cin >> t + 1;
  n = strlen(s + 1);
  m = strlen(t + 1);
  for (int i = 0; i <= n; i++)
    for (int j = 1; j <= n; j++) d[i][j] = inf;
  for (int i = 1; i <= n; i++) {
    pair<int, int> tmp = gao(i);
    int v = tmp.first;
    int k = tmp.second;
    for (int j = 1; j <= n; j++) d[i][j] = min(d[i - 1][j], d[i][j]);
    for (int j = 1; j <= n; j++)
      d[k][j] = min(d[i - 1][j], d[i - 1][j - 1] + v);
  }
  for (int i = n; i >= 0; i--) {
    int ans = 0;
    for (int j = 1; j <= n; j++) {
      if (d[n][j] == j * m && j * m <= i) ans = j;
      if (j * m <= i && j * m + n - d[n][j] >= i) ans = j;
    }
    cout << ans << " ";
  }
}
