#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 7, inf = 0x3f3f3f3f;
int dp[N][N], n, m, i, j, k, len, p, cnt, x;
char s[N], ss[N];
int cal(int x) {
  for (p = m, cnt = 0, k = x; k && p; --k)
    if (ss[p] == s[k])
      p--;
    else
      cnt++;
  if (!p)
    return cnt;
  else
    return inf;
}
int main() {
  for (scanf("%s%s", s + 1, ss + 1), n = strlen(s + 1), m = strlen(ss + 1),
                                     i = 0;
       i <= n; ++i)
    for (j = i + 1; j <= n; ++j) dp[i][j] = -inf;
  for (i = 1; i <= n; ++i)
    for (x = cal(i), j = 0; j <= n; ++j) {
      dp[i][j] = max(dp[i][j], dp[i - 1][j]);
      if (j >= x) dp[i][j] = max(dp[i][j], dp[i - x - m][j - x] + 1);
    }
  for (i = 0; i <= n; ++i) printf("%d ", dp[n][i]);
}
