#include <bits/stdc++.h>
using namespace std;
const int MAX = 2000 + 10;
char s[MAX], p[MAX];
int dp[MAX][MAX];
int main() {
  int n, m;
  while (scanf("%s %s", s + 1, p + 1) == 2) {
    n = strlen(s + 1);
    m = strlen(p + 1);
    memset(dp, -1, sizeof(dp));
    dp[0][0] = 0;
    for (int i = 1; i <= n; i++) {
      int first = i, last = m;
      while (first > 0 && last > 0) {
        if (p[last] == s[first]) {
          last--;
        }
        first--;
      }
      for (int j = 0; j <= i; j++) {
        if (dp[i - 1][j] != -1) dp[i][j] = dp[i - 1][j];
        if (j > 0 && dp[i - 1][j - 1] != -1)
          dp[i][j] = max(dp[i][j], dp[i - 1][j - 1]);
        if (last == 0 && i - first - m <= j &&
            dp[first][j - (i - first - m)] != -1) {
          dp[i][j] = max(dp[i][j], dp[first][j - (i - first - m)] + 1);
        }
      }
    }
    for (int i = 0; i <= n; i++) {
      printf("%d ", dp[n][i]);
    }
    printf("\n");
  }
}
