#include <bits/stdc++.h>
using namespace std;
int n, p, g[2010UL][2010UL], f[2010UL][2010UL];
char s1[2010UL], s2[2010UL];
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  n = strlen(s1 + 1), p = strlen(s2 + 1);
  memset(g, -1, sizeof(g));
  for (int i = 0; i < n; ++i) {
    g[i][0] = i;
    for (int j = 0; j < p; ++j)
      if (g[i][j] != -1) {
        g[i + 1][j] = max(g[i + 1][j], g[i][j]);
        if (s1[i + 1] == s2[j + 1])
          g[i + 1][j + 1] = max(g[i + 1][j + 1], g[i][j]);
      }
  }
  memset(f, -0x3f, sizeof(f));
  f[0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      f[i][j] = f[i - 1][j];
      if (j > 0) f[i][j] = max(f[i][j], f[i - 1][j - 1]);
      if (g[i][p] != -1) {
        int nw = i - g[i][p] - p;
        if (j - nw >= 0) f[i][j] = max(f[i][j], f[g[i][p]][j - nw] + 1);
      }
    }
  }
  for (int i = 0; i <= n; ++i) printf("%d ", f[n][i]);
  return 0;
}
