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 RollingHash {
  static const unsigned long long p = 1000000007ULL;
  string s;
  int n;
  vector<unsigned long long> pow, forHash, revHash;
  RollingHash(string s)
      : s(s), n(s.length()), pow(n + 1), forHash(n + 1), revHash(n + 1) {
    pow[0] = 1;
    forHash[0] = 0;
    for (int i = 0; i < n; i++) {
      forHash[i + 1] = forHash[i] * p + s[i];
      pow[i + 1] = pow[i] * p;
    }
    revHash[n] = 0;
    for (int i = n - 1; i >= 0; i--) {
      revHash[i] = revHash[i + 1] * p + s[i];
    }
  }
  unsigned long long getForHash(int i) const { return forHash[i]; }
  unsigned long long getRevHash(int i) const { return revHash[i]; }
  unsigned long long getForHash(int i, int j) const {
    return getForHash(j + 1) - getForHash(i) * pow[j - i + 1];
  }
  unsigned long long getRevHash(int i, int j) const {
    return getRevHash(i) - getRevHash(j + 1) * pow[j - i + 1];
  }
  bool isPalindrome(int i, int j) {
    return (getForHash(i, j) == getRevHash(i, j));
  }
};
const int Maxn = 5001;
bool dp[Maxn][Maxn][2];
int main() {
  string s;
  cin >> s;
  int x, y, n;
  n = s.length();
  RollingHash r(s);
  vector<int> v(Maxn);
  for (int k = 1; k < 14; k++) {
    for (int i = 0; i < n; i++) {
      int minlen = 1 << (k - 1);
      for (int j = i; j < n; j++) {
        if (j < i + minlen - 1) {
          dp[i][j][0] = 0;
          continue;
        }
        if (k == 1) {
          dp[i][j][0] = r.isPalindrome(i, j);
        } else {
          int len = (j - i + 1) / 2;
          int x = len + i - 1;
          int y = j - len + 1;
          if ((x >= i) && (y <= j)) {
            dp[i][j][0] = r.getForHash(i, x) == r.getForHash(y, j);
            if (dp[i][j][0]) dp[i][j][0] = dp[i][x][1] & dp[y][j][1];
          } else {
            dp[i][j][0] = 0;
          }
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = i; j < n; j++) {
        dp[i][j][1] = dp[i][j][0];
        v[k] += (int)dp[i][j][1];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << v[i] << " ";
  }
  cout << endl;
  return 0;
}