Problem: Palindromic characteristics of string s with length |s| is a sequence of |s| integers, where k-th number is the total number of non-empty substrings of s which are k-palindromes.

A string is 1-palindrome if and only if it reads the same backward as forward.

A string is k-palindrome (k > 1) if and only if: 

  1. Its left half equals to its right half. 
  2. Its left and right halfs are non-empty (k - 1)-palindromes. 



The left half of string t is its prefix of length ⌊|t| / 2⌋, and right half — the suffix of the same length. ⌊|t| / 2⌋ denotes the length of string t divided by 2, rounded down.

Note that each substring is counted as many times as it appears in the string. For example, in the string "aaa" the substring "a" appears 3 times.

Input

The first line contains the string s (1 ≤ |s| ≤ 5000) consisting of lowercase English letters.

Output

Print |s| integers — palindromic characteristics of string s.

Examples

Input

abba


Output

6 1 0 0 


Input

abacaba


Output

12 4 1 0 0 0 0 

Note

In the first example 1-palindromes are substring «a», «b», «b», «a», «bb», «abba», the substring «bb» is 2-palindrome. There are no 3- and 4-palindromes here.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5005;
int dp[MAX_N][MAX_N];
int res[MAX_N];
template <int SZ>
struct rabinKarp {
  const long long mods[3] = {1000000007, 999119999, 1000992299};
  long long p[3][SZ];
  long long h[3][SZ];
  const long long base = 1000696969;
  rabinKarp() {}
  void build(string a) {
    for (int i = 0; i < 3; i++) {
      p[i][0] = 1;
      h[i][0] = (int)a[0];
      for (int j = 1; j < (int)a.length(); j++) {
        p[i][j] = (p[i][j - 1] * mods[i]) % base;
        h[i][j] = (h[i][j - 1] * mods[i] + (int)a[j]) % base;
      }
    }
  }
  tuple<long long, long long, long long> hsh(int a, int b) {
    if (a == 0) return make_tuple(h[0][b], h[1][b], h[2][b]);
    tuple<long long, long long, long long> ans;
    get<0>(ans) =
        (((h[0][b] - h[0][a - 1] * p[0][b - a + 1]) % base) + base) % base;
    get<1>(ans) =
        (((h[1][b] - h[1][a - 1] * p[1][b - a + 1]) % base) + base) % base;
    get<2>(ans) =
        (((h[2][b] - h[2][a - 1] * p[2][b - a + 1]) % base) + base) % base;
    return ans;
  }
};
rabinKarp<MAX_N> rk = rabinKarp<MAX_N>();
bool palin[MAX_N][MAX_N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  rk.build(s);
  int n = (int)s.length();
  for (int i = 0; i < n; i++) palin[i][i] = 1;
  for (int i = 0; i < n - 1; i++)
    if (s[i] == s[i + 1]) palin[i][i + 1] = 1;
  for (int len = 3; len < n + 1; len++) {
    for (int l = 0; l < n; l++)
      if (l + len - 1 < n) {
        if (s[l] == s[l + len - 1] && palin[l + 1][l + len - 2])
          palin[l][l + len - 1] = 1;
      }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (palin[i][j]) dp[i][j] = 1;
  for (int len = 2; len < n + 1; len++) {
    for (int l = 0; l < n; l++)
      if (l + len - 1 < n) {
        if (dp[l][l + len - 1] == 0 && dp[l][l + len / 2 - 1] == 0) {
          dp[l][l + len - 1] = 0;
          continue;
        }
        if (len & 1) {
          if (rk.hsh(l, l + len / 2 - 1) ==
              rk.hsh(l + len / 2 + 1, l + len - 1)) {
            dp[l][l + len - 1] = 1 + dp[l][l + len / 2 - 1];
          }
        } else {
          if (rk.hsh(l, l + len / 2 - 1) == rk.hsh(l + len / 2, l + len - 1)) {
            dp[l][l + len - 1] = 1 + dp[l][l + len / 2 - 1];
          }
        }
      }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i <= j) res[dp[i][j]]++;
  for (int i = (n + 1) - 1; i >= 0; i--) res[i] += res[i + 1];
  for (int i = 1; i < n + 1; i++) cout << res[i] << " ";
  cout << "\n";
}