#include <bits/stdc++.h>
using namespace std;
const int MAXn = 2005;
int dp[MAXn][MAXn];
const int INF = 1e9;
int ans[MAXn];
int main() {
  ios::sync_with_stdio(false);
  string s, p;
  cin >> s >> p;
  int n = s.size();
  int m = p.size();
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++) dp[i][j] = INF;
  dp[0][0] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= n; j++) {
      if (dp[i][j] == INF) continue;
      int k = j % m;
      dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + 1);
      if (k == 0) dp[i + 1][j] = min(dp[i + 1][j], dp[i][j]);
      if (s[i] == p[k]) dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j]);
    }
  for (int i = 0; i <= n; i++) {
    int rem = dp[n][i];
    if (rem == INF) continue;
    int k = i / m;
    for (int j = rem; j <= n - m * k; j++) ans[j] = max(ans[j], k);
  }
  for (int i = 0; i <= n; i++) cout << ans[i] << " ";
  cout << '\n';
  return 0;
}
