Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates <image> that is defined as the maximal number of non-overlapping substrings equal to p that can be found in s'. He wants to make this number as big as possible.

More formally, let's define <image> as maximum value of <image> over all s' that can be obtained by removing exactly x characters from s. Dreamoon wants to know <image> for all x from 0 to |s| where |s| denotes the length of string s.

Input

The first line of the input contains the string s (1 ≤ |s| ≤ 2 000).

The second line of the input contains the string p (1 ≤ |p| ≤ 500).

Both strings will only consist of lower case English letters.

Output

Print |s| + 1 space-separated integers in a single line representing the <image> for all x from 0 to |s|.

Examples

Input

aaaaa
aa


Output

2 2 1 1 0 0


Input

axbaxxb
ab


Output

0 1 1 2 1 1 0 0

Note

For the first sample, the corresponding optimal values of s' after removal 0 through |s| = 5 characters from s are {"aaaaa", "aaaa", "aaa", "aa", "a", ""}. 

For the second sample, possible corresponding optimal values of s' are {"axbaxxb", "abaxxb", "axbab", "abab", "aba", "ab", "a", ""}.
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 2e9;
const long long INFLL = 1e18;
const int MAX_N = 2000;
vector<int> v;
string S, P;
int st[MAX_N + 1];
int dp[MAX_N + 1][MAX_N + 1];
int D[MAX_N + 1];
int s[MAX_N + 1], e[MAX_N + 1];
priority_queue<int> pq1, pq2;
vector<pair<int, int> > vt;
int main() {
  cin >> S >> P;
  for (int i = 0; i < S.size(); i++) {
    int k = P.size() - 1;
    st[i] = -1;
    for (int j = i; j >= 0; j--) {
      if (S[j] == P[k]) {
        if (k == 0) {
          st[i] = j;
          break;
        } else {
          k--;
        }
      }
    }
    if (st[i] != -1) {
      if (st[i] == 0)
        D[i] = 1;
      else
        D[i] = D[st[i] - 1] + 1;
    }
  }
  for (int i = 0; i < S.size(); i++) {
    for (int j = 1; j < S.size(); j++) {
      dp[i][j] = INF;
    }
  }
  for (int i = 0; i < S.size(); i++) {
    for (int j = 0; j <= D[i]; j++) {
      if (i != 0) dp[i][j] = dp[i - 1][j];
    }
    if (D[i] != 0) {
      if (st[i] == 0) {
        dp[i][D[i]] = min(dp[i][D[i]], (int)(i - st[i] + 1 - P.size()));
      } else {
        for (int j = 1; j <= D[i]; j++) {
          dp[i][j] = min(
              dp[i][j], dp[st[i] - 1][j - 1] + (int)(i - st[i] + 1 - P.size()));
        }
      }
    }
  }
  for (int i = 0; i <= D[S.size() - 1]; i++) {
    s[i] = dp[S.size() - 1][i];
    e[i] = S.size() - P.size() * i;
    vt.push_back({s[i], i});
    vt.push_back({e[i] + 1, -i - 1});
  }
  sort(vt.begin(), vt.end());
  int idx = 0;
  for (int i = 0; i <= S.size(); i++) {
    while (idx < vt.size() && vt[idx].first == i) {
      if (vt[idx].second >= 0) {
        pq1.push(vt[idx].second);
      } else {
        pq2.push(-vt[idx].second - 1);
      }
      idx++;
    }
    while (!pq1.empty() && !pq2.empty() && pq1.top() == pq2.top()) {
      pq1.pop();
      pq2.pop();
    }
    printf("%d ", pq1.top());
  }
  return 0;
}
