#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 2e9;
const long long INFLL = 1e18;
const int MAX_N = 2000;
vector<int> v;
string S, P;
int st[MAX_N + 1];
int dp[MAX_N + 1][MAX_N + 1];
int D[MAX_N + 1];
int s[MAX_N + 1], e[MAX_N + 1];
priority_queue<int> pq1, pq2;
vector<pair<int, int> > vt;
int main() {
  cin >> S >> P;
  for (int i = 0; i < S.size(); i++) {
    int k = P.size() - 1;
    st[i] = -1;
    for (int j = i; j >= 0; j--) {
      if (S[j] == P[k]) {
        if (k == 0) {
          st[i] = j;
          break;
        } else {
          k--;
        }
      }
    }
    if (st[i] != -1) {
      if (st[i] == 0)
        D[i] = 1;
      else
        D[i] = D[st[i] - 1] + 1;
    }
  }
  for (int i = 0; i < S.size(); i++) {
    for (int j = 1; j < S.size(); j++) {
      dp[i][j] = INF;
    }
  }
  for (int i = 0; i < S.size(); i++) {
    for (int j = 0; j <= D[i]; j++) {
      if (i != 0) dp[i][j] = dp[i - 1][j];
    }
    if (D[i] != 0) {
      if (st[i] == 0) {
        dp[i][D[i]] = min(dp[i][D[i]], (int)(i - st[i] + 1 - P.size()));
      } else {
        for (int j = 1; j <= D[i]; j++) {
          dp[i][j] = min(
              dp[i][j], dp[st[i] - 1][j - 1] + (int)(i - st[i] + 1 - P.size()));
        }
      }
    }
  }
  for (int i = 0; i <= D[S.size() - 1]; i++) {
    s[i] = dp[S.size() - 1][i];
    e[i] = S.size() - P.size() * i;
    vt.push_back({s[i], i});
    vt.push_back({e[i] + 1, -i - 1});
  }
  sort(vt.begin(), vt.end());
  int idx = 0;
  for (int i = 0; i <= S.size(); i++) {
    while (idx < vt.size() && vt[idx].first == i) {
      if (vt[idx].second >= 0) {
        pq1.push(vt[idx].second);
      } else {
        pq2.push(-vt[idx].second - 1);
      }
      idx++;
    }
    while (!pq1.empty() && !pq2.empty() && pq1.top() == pq2.top()) {
      pq1.pop();
      pq2.pop();
    }
    printf("%d ", pq1.top());
  }
  return 0;
}
