#include <bits/stdc++.h>
using namespace std;
int res[2010][2010], i, j, k, l1, l2, cnt;
int main() {
  string s, p;
  cin >> s >> p;
  l1 = s.length();
  l2 = p.length();
  memset(res, 0, sizeof(res));
  if (l2 == 1 && p[0] == s[0]) res[0][0] = 1;
  for (i = 1; i < l1; ++i) {
    res[i][0] = res[i - 1][0];
    for (j = 1; j <= (i + 1); ++j)
      res[i][j] = max(res[i - 1][j], res[i - 1][j - 1]);
    k = l2 - 1;
    if (s[i] == p[k]) {
      cnt = 0;
      j = i;
      for (; j >= 0; --j) {
        if (s[j] == p[k]) {
          --k;
          if (k < 0) break;
        } else
          ++cnt;
      }
      if (j > 0) {
        for (k = cnt; (k - cnt) <= j; ++k) {
          if (res[j - 1][k - cnt] + 1 > res[i][k]) {
            res[i][k] = res[j - 1][k - cnt] + 1;
          }
        }
      } else if (j == 0) {
        if (res[i][cnt] < 1) res[i][cnt] = 1;
      }
    }
  }
  for (i = 0; i <= l1; ++i) printf("%d ", res[l1 - 1][i]);
}
