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 MAX_N = 5e3 + 15, BASE = 37, MOD = 1e9 + 9;
long long n;
string s;
long long pow_b[MAX_N], div_b[MAX_N];
long long p_hash[2][MAX_N];
long long pal_num[MAX_N][MAX_N];
long long cnt[MAX_N];
long long Pow(long long a, long long b) {
  if (!b) return 1;
  long long res = Pow(a, b >> 1);
  res = (res * res) % MOD;
  if (b & 1) res = (res * a) % MOD;
  return res;
}
long long is_pal(long long l, long long r) {
  long long tmp1 = (p_hash[0][r] - (l ? p_hash[0][l - 1] : 0) + MOD) % MOD;
  tmp1 = 1LL * tmp1 * div_b[l] % MOD;
  long long tmp2 = (p_hash[1][l] - p_hash[1][r + 1] + MOD) % MOD;
  tmp2 = 1LL * tmp2 * div_b[s.size() - 1 - r] % MOD;
  return tmp1 == tmp2;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  pow_b[0] = 1;
  div_b[0] = 1;
  for (long long i = 1; i < MAX_N; i++) {
    pow_b[i] = (1LL * pow_b[i - 1] * BASE) % MOD;
    div_b[i] = Pow(pow_b[i], MOD - 2);
  }
  cin >> s;
  p_hash[0][0] = s[0] - 'a';
  for (long long i = 1; i < s.size(); i++)
    p_hash[0][i] =
        (p_hash[0][i - 1] + 1LL * (s[i] - 'a') * pow_b[i] % MOD) % MOD;
  p_hash[1][s.size() - 1] = s[s.size() - 1] - 'a';
  for (long long i = s.size() - 2; ~i; i--)
    p_hash[1][i] = (p_hash[1][i + 1] +
                    1LL * (s[i] - 'a') * pow_b[s.size() - 1 - i] % MOD) %
                   MOD;
  for (long long i = 0; i < s.size(); i++)
    for (long long j = 0; j + i < s.size(); j++)
      if (is_pal(j, j + i)) {
        pal_num[j][j + i] = 1 + min(pal_num[j][j + ((i - 1) >> 1)],
                                    pal_num[j + i - ((i - 1) >> 1)][j + i]);
        cnt[pal_num[j][j + i]]++;
      }
  for (long long i = s.size(); ~i; i--) cnt[i] += cnt[i + 1];
  for (long long i = 1; i <= s.size(); i++) cout << cnt[i] << " ";
  return 0;
}