#include <bits/stdc++.h>
using namespace std;
int nxt[2005], cnt[2005], dp[2005][2005], n, m;
char a[2005], b[2005];
inline void Make(int p) {
  if (a[p] != b[1]) return;
  int i, j;
  for (i = p + 1, j = 2; i <= n && j <= m; ++i)
    if (a[i] != b[j])
      ++cnt[p];
    else
      ++j;
  if (j <= m) return;
  nxt[p] = i;
}
int main() {
  int i, j;
  cin.sync_with_stdio(false);
  cin >> (a + 1) >> (b + 1);
  n = strlen(a + 1);
  m = strlen(b + 1);
  for (i = 1; i <= n; ++i) Make(i);
  for (i = 0; i <= n + 1; ++i)
    for (j = 0; j <= n + 1; ++j) dp[i][j] = -1000000000;
  dp[n + 1][0] = 0;
  for (i = n; i; --i)
    for (j = 0; j <= n - i + 1; ++j) {
      dp[i][j] = dp[i + 1][j];
      if (j) dp[i][j] = max(dp[i][j], dp[i + 1][j - 1]);
      if (nxt[i] && cnt[i] <= j)
        dp[i][j] = max(dp[i][j], dp[nxt[i]][j - cnt[i]] + 1);
    }
  for (i = 0; i <= n; ++i) cout << dp[1][i] << " ";
  cout << "\n";
  return 0;
}
