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>
const int maxn = 1e6 + 10;
std::vector<int> G[maxn];
struct Palindromic_Automaton {
  int n, last, nodecnt;
  int s[maxn];
  int len[maxn];
  int fail[maxn];
  int size[maxn];
  int nxt[maxn][26];
  void init() {
    s[n = 0] = len[nodecnt = 1] = -1;
    fail[last = 0] = 1;
    G[1].push_back(0);
  }
  void extend(int c) {
    s[++n] = c;
    int cur = last;
    while (s[n - len[cur] - 1] != s[n]) cur = fail[cur];
    if (nxt[cur][c] == 0) {
      int np = ++nodecnt, p = fail[cur];
      len[np] = len[cur] + 2;
      while (s[n - len[p] - 1] != s[n]) p = fail[p];
      fail[np] = nxt[p][c], nxt[cur][c] = np;
      G[fail[np]].push_back(np);
    }
    ++size[last = nxt[cur][c]];
  }
  void construct() {
    for (int i = nodecnt; i >= 1; i--) size[fail[i]] += size[i];
  }
} pam;
int n;
int buc[maxn];
int value[maxn];
char str[maxn];
void dfs(int u) {
  if (pam.len[u] > 0) {
    value[pam.len[u]] = value[pam.len[u] / 2] + 1;
    buc[value[pam.len[u]]] += pam.size[u];
  }
  for (int v : G[u]) dfs(v);
  if (pam.len[u] > 0) value[pam.len[u]] = 0;
}
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  pam.init();
  for (int i = 1; i <= n; i++) pam.extend(str[i] - 'a');
  pam.construct();
  dfs(1);
  for (int i = n; i >= 1; i--) buc[i] += buc[i + 1];
  for (int i = 1; i <= n; i++) printf("%d%c", buc[i], " \n"[i == n]);
  return 0;
}