#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
vector<int> g[30];
int dp[N][N], nxt[N];
string s, p;
int calc(int idx, int rem) {
  if (rem < 0) return -1e9;
  if (idx == s.size()) {
    return (rem == 0 ? 0 : -1e9);
  }
  int &ret = dp[idx][rem];
  if (ret != -1) return ret;
  ret = calc(idx + 1, rem);
  ret = max(ret, calc(idx + 1, rem - 1));
  if (nxt[idx] != -1) {
    int toDelete = (nxt[idx] - idx + 1) - p.size();
    ret = max(ret, 1 + calc(nxt[idx] + 1, rem - toDelete));
  }
  return ret;
}
int main() {
  memset(nxt, -1, sizeof nxt);
  memset(dp, -1, sizeof dp);
  cin >> s >> p;
  for (int i = 0; i < s.size(); ++i) {
    g[s[i] - 'a'].push_back(i);
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == p[0]) {
      int idx = i;
      int cur = 1;
      while (cur < p.size() && idx < s.size()) {
        if (upper_bound(g[p[cur] - 'a'].begin(), g[p[cur] - 'a'].end(), idx) ==
            g[p[cur] - 'a'].end())
          break;
        idx = *upper_bound(g[p[cur] - 'a'].begin(), g[p[cur] - 'a'].end(), idx);
        cur++;
      }
      if (cur == p.size()) {
        nxt[i] = idx;
      }
    }
  }
  for (int x = 0; x <= s.size(); x++) {
    printf("%d ", calc(0, x));
  }
  return 0;
}
