#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 1;
int dp[N][N];
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int i2 = 0;
  for (int i = 1; i <= s1.size(); i++) {
    int l2 = s2.size();
    for (i2 = i; i2 && l2; i2--)
      if (s1[i2 - 1] == s2[l2 - 1]) l2--;
    if (!l2) {
      int deletee = i - i2 - s2.size();
      for (int i3 = deletee; i3 <= i - s2.size(); i3++)
        dp[i][i3] = max(dp[i][i3], dp[i2][i3 - deletee] + 1);
    }
    for (i2 = 0; i2 < i; i2++) dp[i][i2] = max(dp[i][i2], dp[i - 1][i2]);
  }
  for (int i = 0; i < s1.size(); i++) cout << dp[s1.size()][i] << " ";
  cout << 0;
  return 0;
}
