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 long long int M = 5000 + 5, SM = 600;
const long long int inf = 1e18, mod = 1e9 + 7;
const long long int lg = 17;
long long int hsh[M], bsh[M];
long long int p727[2 * M];
long long int n;
long long int ghsh(long long int l, long long int r) {
  long long int x = hsh[r - 1] - hsh[l - 1];
  x += 3 * mod;
  x %= mod;
  x *= p727[M - l];
  x %= mod;
  return x;
}
long long int gbsh(long long int l, long long int r) {
  long long int x = bsh[r - 1] - bsh[l - 1];
  x += 3 * mod;
  x %= mod;
  x *= p727[M - l];
  x %= mod;
  return x;
}
bool isp(long long int l, long long int r) {
  return (ghsh(l, r) == gbsh(n - r + 1, n - l + 1));
}
long long int levelpal[M][M];
long long int cnt[M];
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  p727[0] = 1;
  for (long long int i = 1; i < 2 * M; i++) {
    p727[i] = p727[i - 1] * 729;
    p727[i] %= mod;
  }
  n = ((long long int)s.size());
  for (long long int i = 0; i < n; i++) {
    hsh[i + 1] = hsh[i] + s[i] * p727[i];
    hsh[i + 1] %= mod;
  }
  string sp = s;
  reverse(s.begin(), s.end());
  swap(sp, s);
  for (long long int i = 0; i < n; i++) {
    bsh[i + 1] = bsh[i] + sp[i] * p727[i];
    bsh[i + 1] %= mod;
  }
  for (long long int siz = 0; siz < n; siz++) {
    for (long long int l = 1; l < n + 1 - siz; l++) {
      if (isp(l, l + siz)) {
        levelpal[l][l + siz] = 1;
        if (siz == 0) continue;
        long long int st2 = siz / 2;
        if (siz % 2 == 0) st2--;
        if (isp(l, l + st2)) {
          if (ghsh(l, l + st2) == ghsh(l + siz - st2, l + siz)) {
            levelpal[l][l + siz] = levelpal[l][l + st2] + 1;
          }
        }
      }
    }
  }
  for (long long int l = 1; l < n + 1; l++) {
    for (long long int r = l; r < n + 1; r++) {
      cnt[levelpal[l][r]]++;
    }
  }
  for (long long int i = n - 1; i >= 0; i--) {
    cnt[i] += cnt[i + 1];
  }
  for (long long int i = 1; i < n + 1; i++) {
    cout << cnt[i] << ' ';
  }
}