#include <bits/stdc++.h>
using namespace std;
char s[2010], p[510];
int l1, l2, a[2010], dp[2010][2010];
int main() {
  memset(a, 255, sizeof(a));
  scanf("%s%s", s + 1, p + 1);
  l1 = strlen(s + 1);
  l2 = strlen(p + 1);
  for (int i = 1; i <= l1; i++) {
    int np = 1;
    for (int j = i; j <= l1; j++) {
      if (s[j] == p[np]) np++;
      if (np == l2 + 1) {
        a[i] = j - i + 1;
        break;
      }
    }
  }
  for (int i = 0; i <= l1; i++) fill(dp[i], dp[i] + l1 + 1, -1e9);
  dp[0][0] = 0;
  for (int i = 0; i < l1; i++) {
    for (int j = 0; j <= i; j++) {
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
      dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j]);
      if (a[i + 1] != -1)
        dp[i + a[i + 1]][j + a[i + 1] - l2] =
            max(dp[i + a[i + 1]][j + a[i + 1] - l2], dp[i][j] + 1);
    }
  }
  for (int i = 0; i <= l1; i++) printf("%d ", dp[l1][i]);
  return 0;
}
