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;
struct Hash {
  long long sufsum[10001];
  long long p[10001];
  long long mod;
  string str;
  Hash(string s, long long prim = 173, long long _mod = 1000000009) {
    mod = _mod;
    str = s;
    p[0] = 1;
    for (long long i = 1; i < s.length(); i++) {
      p[i] = (long long)(p[i - 1] * prim) % mod;
    }
    long long i = s.length() - 1;
    sufsum[i] = s[i];
    for (long long i = s.length() - 2; i >= 0; i--) {
      sufsum[i] = (s[i] + sufsum[i + 1] * prim) % mod;
    }
  }
  long long rquery(long long i, long long j) const {
    return (mod * mod + sufsum[i] - sufsum[j + 1] * p[j + 1 - i]) % mod;
  }
  bool equal(long long i, long long j, long long i2, long long j2) {
    bool ans = false;
    ans = (rquery(i, j) == rquery(i2, j2));
    return ans;
  }
};
bool isPalin[5001][5001];
int maxPal[5001][5001];
int palindex[5001];
int main() {
  string str;
  cin >> str;
  int N = str.length();
  Hash hash = Hash(str);
  for (int i = 0; i < N; i++) {
    isPalin[i][i] = true;
    maxPal[i][i] = 1;
    if (i < N - 1) {
      if (str[i] == str[i + 1]) {
        isPalin[i][i + 1] = true;
        maxPal[i][i + 1] = 2;
      }
    }
  }
  for (int s = N - 2; s >= 0; s--) {
    for (int e = s + 1; e < N; e++) {
      if (s == e || s + 1 == e) continue;
      isPalin[s][e] = ((str[s] == str[e]) && isPalin[s + 1][e - 1]);
      if (isPalin[s][e]) {
        maxPal[s][e] = max(maxPal[s][e], 1);
      }
    }
  }
  for (int i = 0; i < N - 2; i++) {
    for (int j = i + 2; j < N; j++) {
      int step = (j - i - 1) / 2;
      if (hash.equal(i, i + step, j - step, j) && isPalin[i][i + step]) {
        maxPal[i][j] = max(maxPal[i][j], 1 + maxPal[i][i + step]);
      }
    }
  }
  int onepalins = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i; j < N; j++) {
      palindex[maxPal[i][j]]++;
      onepalins += 1 * isPalin[i][j];
    }
  }
  int total[5001];
  total[N] = palindex[N];
  for (int i = N - 1; i >= 1; i--) {
    total[i] = total[i + 1] + palindex[i];
  }
  for (int i = 1; i <= N; i++) {
    cout << total[i] << ' ';
  }
  cout << '\n';
  return 0;
}