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>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long a, long long b, long long m = 1000000007) {
  long long answer = 1;
  while (b) {
    if (b & 1) answer = (answer * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return answer;
}
using namespace std;
void ctrl() { cout << "Control\n"; }
const long long N = 5000 + 5;
long long hashf[N], hashr[N];
long long degree[N][N], inv[N];
long long len;
long long forhash(long long l, long long r) {
  long long x = (hashf[r] - hashf[l - 1] + 1000000007) % 1000000007;
  return (x * inv[l - 1]) % 1000000007;
}
long long revhash(long long l, long long r) {
  long long x = (hashr[r] - hashr[l - 1] + 1000000007) % 1000000007;
  return (x * inv[l - 1]) % 1000000007;
}
long long calc(long long l, long long r) {
  if (l > r) return 0;
  if (l == r) return 1;
  if (degree[l][r] != -1) return degree[l][r];
  long long ans = 0;
  long long mid = (l + r + 1) / 2;
  long long x = forhash(l + 1, r + 1);
  long long y = revhash(len - r, len - l);
  if ((r - l) % 2 == 0) {
    if (x == y)
      ans = 1 + min(calc(l, mid - 1), calc(mid + 1, r));
    else {
      ans = 0;
    }
  } else {
    if (x == y)
      ans = 1 + min(calc(l, mid - 1), calc(mid, r));
    else {
      ans = 0;
    }
  }
  return degree[l][r] = ans;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string p;
  cin >> p;
  string q;
  q = p;
  len = p.length();
  reverse(q.begin(), q.end());
  memset(degree, -1, sizeof(degree));
  hashf[0] = hashr[0] = 0;
  long long pr = 29;
  inv[0] = 1, inv[1] = power(29, 1000000007 - 2, 1000000007);
  for (long long i = 0; i < p.length(); i++) {
    hashf[i + 1] = (p[i] - 'a' + 1) * pr;
    hashf[i + 1] %= 1000000007;
    hashf[i + 1] += hashf[i];
    hashf[i + 1] %= 1000000007;
    hashr[i + 1] = (q[i] - 'a' + 1) * pr;
    hashr[i + 1] %= 1000000007;
    hashr[i + 1] += hashr[i];
    hashr[i + 1] %= 1000000007;
    pr = (pr * 29) % 1000000007;
    inv[i + 2] = power(pr, 1000000007 - 2, 1000000007);
  }
  long long cost[len + 5];
  for (long long i = 0; i < len + 5; i++) cost[i] = 0;
  for (long long i = 0; i < p.length(); i++) {
    for (long long j = i; j < p.length(); j++) {
      long long x = calc(i, j);
      cost[x]++;
    }
  }
  for (long long i = len; i >= 2; i--) cost[i - 1] += cost[i];
  for (long long i = 1; i <= len; i++) cout << cost[i] << " ";
  return 0;
}