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 nMOD = 5;
const long long base = 31;
long long MOD[nMOD];
long long h[5005][nMOD];
long long inv[5005][nMOD];
long long pw[5005][nMOD];
long long dp[5005][5005];
long long ans[5005];
long long n;
string s;
long long gethash(long long l, long long r, long long d) {
  return (h[r][d] - h[l - 1][d] * pw[r - l + 1][d] + MOD[d] * MOD[d]) % MOD[d];
}
long long getinv(long long l, long long r, long long d) {
  return (inv[l][d] - inv[r + 1][d] * pw[r - l + 1][d] + MOD[d] * MOD[d]) %
         MOD[d];
}
void init() {
  for (long long d = 0; d < nMOD; d++) {
    for (long long i = 1; i <= n; i++) {
      h[i][d] = (base * h[i - 1][d] + s[i] - 'a') % MOD[d];
    }
  }
  for (long long d = 0; d < nMOD; d++) {
    for (long long i = n; i >= 1; i--) {
      inv[i][d] = (base * inv[i + 1][d] + s[i] - 'a') % MOD[d];
    }
  }
  for (long long d = 0; d < nMOD; d++) {
    pw[0][d] = 1;
    for (long long i = 1; i <= n; i++) {
      pw[i][d] = (pw[i - 1][d] * base) % MOD[d];
    }
  }
}
bool palin(long long l, long long r) {
  long long cnt = 0;
  for (long long d = 0; d < nMOD; d++) {
    cnt += (gethash(l, r, d) == getinv(l, r, d));
  }
  return cnt == nMOD;
}
bool same(long long l, long long r, long long u, long long v) {
  long long cnt = 0;
  for (long long d = 0; d < nMOD; d++) {
    cnt += (gethash(l, r, d) == gethash(u, v, d));
  }
  return cnt == nMOD;
}
signed main() {
  cin >> s;
  n = s.size();
  s = ' ' + s;
  MOD[0] = 1e9 + 7;
  MOD[1] = 1e9 + 123;
  MOD[2] = 1e9 + 321;
  MOD[3] = 1e9 + 87;
  MOD[4] = 1e9 + 9;
  init();
  for (long long i = 1; i <= n; i++) dp[i][i] = 1;
  for (long long len = 1; len <= n; len++) {
    for (long long l = 1; l + len - 1 <= n; l++) {
      long long r = l + len - 1;
      long long mid = (l + r) >> 1;
      if (palin(l, r)) {
        dp[l][r] = 1;
        if ((r - l + 1) & 1) {
          if (same(l, mid - 1, mid + 1, r)) {
            dp[l][r] = dp[l][mid - 1] + 1;
          }
        } else {
          if (same(l, mid, mid + 1, r)) {
            dp[l][r] = dp[l][mid] + 1;
          }
        }
      }
    }
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = i; j <= n; j++) {
      if (dp[i][j] > 0) {
        ans[1]++;
        ans[dp[i][j] + 1]--;
      }
    }
  for (long long i = 1; i <= n; i++) {
    ans[i] += ans[i - 1];
    cout << ans[i] << " ";
  }
  return 0;
}