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;
namespace {
const static int INF = 0x1f1f1f1f;
int len[2020];
int cost[2020];
int dp[2020][2020];
int cheapest[2020];
string s, p;
int x, y;
int calcLen(int i_in) {
  int i = i_in, j = 0;
  for (; j < p.size(); ++i) {
    if (i == s.size()) return INF;
    if (s[i] == p[j]) ++j;
  }
  return i - i_in;
}
};  // namespace
int main() {
  cin >> s >> p;
  memset(len, INF, sizeof(len));
  memset(cost, INF, sizeof(cost));
  memset(cheapest, INF, sizeof(cheapest));
  x = s.size(), y = p.size();
  for (int i = 0; i + y <= x; ++i) {
    len[i] = calcLen(i);
    cost[i] = len[i] == INF ? INF : len[i] - y;
  }
  int best = 0;
  {
    int current = 0;
    while (current < x && len[current] < INF) {
      ++best;
      current += len[current];
    }
  }
  memset(dp, INF, sizeof(dp));
  dp[x][0] = 0;
  for (int i = x - 1; i >= 0; --i) {
    dp[i][0] = 0;
    for (int j = 1; j <= best; ++j) {
      dp[i][j] = dp[i + 1][j];
      if (cost[i] < INF) {
        dp[i][j] = min(dp[i][j], dp[i + len[i]][j - 1] + cost[i]);
      }
      cheapest[j] = min(cheapest[j], dp[i][j]);
    }
  }
  vector<int> ret(x + 1, 0);
  for (int i = 0; i < ret.size(); ++i) {
    ret[i] = i / y;
  }
  reverse(ret.begin(), ret.end());
  int currentCheapest(0);
  for (int idx = 0; idx < ret.size(); ++idx) {
    while (idx >= cheapest[currentCheapest + 1]) {
      ++currentCheapest;
    }
    ret[idx] = min(ret[idx], currentCheapest);
    cout << ret[idx] << " ";
  }
  return 0;
}
