#include <bits/stdc++.h>
using namespace std;
void open() {
  freopen("string.in", "r", stdin);
  freopen("string.out", "w", stdout);
}
class party {
 public:
  char s[3000], p[1000];
  int A[3000], f[3000][3000], ls, lp;
  void work() {
    scanf("%s%s", s + 1, p + 1);
    ls = strlen(s + 1);
    lp = strlen(p + 1);
    pre_process();
    top_process();
    for (int i = 0; i < ls; ++i) printf("%d ", f[ls][i]);
    printf("%d\n", f[ls][ls]);
  }

 private:
  void pre_process() {
    int t;
    for (int pos = 1; pos <= ls; ++pos) {
      t = pos - 1;
      for (int i = 1; i <= lp; ++i) {
        ++t;
        while (s[t] != p[i] && t <= ls) ++t;
      }
      A[pos] = t;
    }
  }
  void top_process() {
    for (int i = 1; i <= ls; ++i) {
      for (int j = 0; j <= min(ls, i - 1); ++j) {
        f[i + 1][j] = max(f[i + 1][j], f[i][j]);
        f[i + 1][j + 1] = max(f[i + 1][j + 1], f[i][j]);
        f[A[i]][j + A[i] - i + 1 - lp] =
            max(f[A[i]][j + A[i] - i + 1 - lp], f[i - 1][j] + 1);
      }
    }
  }
} diary;
int main() {
  diary.work();
  return 0;
}
