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;
long long int bpow(long long int x, long long int n, long long int mod) {
  long long int ans = 1;
  while (n > 0) {
    if (n & 1) ans *= x;
    x *= x;
    ans %= mod;
    x %= mod;
    n /= 2;
  }
  return ans;
}
class StringHash {
  const static int MAX = 300005;
  long long int b = 789456123;
  long long int m = 1000000007;
  long long int B[MAX], inverseB[MAX];

 public:
  void initialize() {
    B[0] = 1;
    for (int i = 1; i < MAX; i++) {
      B[i] = (B[i - 1] * b) % m;
    }
    inverseB[MAX - 1] = bpow(B[MAX - 1], m - 2, m);
    for (int i = MAX - 2; i >= 0; i--) {
      inverseB[i] = (inverseB[i + 1] * b) % m;
    }
  }
  long long int getHash(string &s) {
    long long h = 0;
    for (int i = 0; i < s.size(); i++) {
      h = (h + (s[i] - 'a') * B[i]) % m;
    }
    return h;
  }
  int length = 0;
  long long int h[MAX], revh[MAX];
  long long int construct(string &s) {
    length = s.size();
    h[0] = 0, revh[length + 1] = 0;
    for (int i = 0, j = 1; i < s.size(); i++, j++) {
      h[j] = (h[j - 1] + ((s[i] - 'a') * B[i]) % m) % m;
    }
    for (int i = length - 1, j = length, k = 0; i >= 0; i--, j--, k++) {
      revh[j] = (revh[j + 1] + ((s[i] - 'a') * B[k]) % m) % m;
    }
    return h[length];
  }
  long long int getSubHash(int i, int j) {
    i++, j++;
    return ((h[j] + (m - h[i - 1])) * inverseB[i - 1]) % m;
  }
  long long int getRevHash(int i, int j) {
    i++, j++;
    return ((revh[i] + (m - revh[j + 1])) * inverseB[length - j]) % m;
  }
};
StringHash H;
int dp[5005][5005], ans[5005], leni, pal[5005][5005];
string s;
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  int i, j, x, y, l, l1, l2, r1, r2, len;
  H.initialize();
  cin >> s;
  leni = s.length();
  H.construct(s);
  for (i = 0; i < leni; i++) pal[i][i] = 1;
  for (i = 0; i < leni - 1; i++) {
    if (s[i] == s[i + 1]) pal[i][i + 1] = 1;
  }
  for (l = 3; l <= leni; l++) {
    for (i = 0; i + l - 1 < leni; i++) {
      j = i + l - 1;
      pal[i][j] = (s[i] == s[j] && pal[i + 1][j - 1]);
    }
  }
  for (i = 0; i < leni; i++) dp[i][i] = 1;
  for (i = 0; i < leni - 1; i++) {
    if (s[i] == s[i + 1]) dp[i][i + 1] = 2;
  }
  for (i = 0; i < leni; i++) {
    for (j = i; j < leni; j++) {
      if (pal[i][j]) dp[i][j] = max(dp[i][j], 1);
    }
  }
  for (l = 3; l <= leni; l++) {
    for (i = 0; i + l - 1 < leni; i++) {
      j = i + l - 1;
      len = (j - i + 1) / 2;
      l1 = i;
      r1 = i + len - 1;
      r2 = j;
      l2 = j - len + 1;
      if (H.getSubHash(l1, r1) != H.getSubHash(l2, r2)) continue;
      x = dp[l1][r1];
      y = dp[l2][r2];
      if (x == 0 || y == 0) continue;
      dp[i][j] = max(dp[i][j], min(x, y) + 1);
    }
  }
  for (i = 0; i < leni; i++) {
    for (j = i; j < leni; j++) {
      if (!dp[i][j]) continue;
      ans[1]++;
      ans[dp[i][j] + 1]--;
    }
  }
  for (i = 1; i <= leni; i++) ans[i] += ans[i - 1];
  for (i = 1; i <= leni; i++) cout << ans[i] << " ";
  return 0;
}