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 JAVA):

Solution:
/*
#string #hashing #dp
*/
import java.util.Scanner;
public class PalindromicCharacteristics {
    static int base = 27;
    static int MAXN = 5001;
    static long MOD = 1_000_000_007L;
    static long[] mul = new long[MAXN];
    static {
        // preprocess
        mul[0] = 1;
        for (int i=1; i < MAXN; i++) {
            mul[i] = (mul[i-1] * base) % MOD;
        }
    }
    public static long calculateHashCode(String s, long[] hashArr) {
        long hashValue = 0;
        int sz = s.length();
        int val;
        for (int i=0; i < sz; i++) {
            val = s.charAt(i) - 'a' + 1;
            hashValue = (val + (base * hashValue) % MOD) % MOD;
            hashArr[i+1] = hashValue;
        }
        return hashValue;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int sz = s.length() + 1;
        long[] hashArrLeft = new long[sz];
        long[] hashArrRight = new long[sz];
        // calculate hashcode
        calculateHashCode(s, hashArrLeft);
        calculateHashCode(new StringBuilder(s).reverse().toString(), hashArrRight);
        
        int[] result = new int[sz];
        int[][] palindrome = new int[sz][sz];
        int len, l, r;
        long hashLeft, hashRight;
        for (int i=1; i < sz; i++) {
            palindrome[i][i] = 1;
            result[1]++;
            for (int j=i+1; j < sz; j++) {
                len = (j - i + 1) / 2;
                // calculate hashCode left and right
                l = i; r = l + len - 1;
                /* hash(l, r) = (hash[r] - (hash[l - 1] * pw[r - l + 1]) % MOD + MOD) % MOD */
                hashLeft = (hashArrLeft[r] - (hashArrLeft[l - 1] * mul[r - l + 1]) % MOD + MOD) % MOD;
                l = sz - j; r = l + len - 1;
                hashRight = (hashArrRight[r] - (hashArrRight[l - 1] * mul[r - l + 1]) % MOD + MOD) % MOD;

                // check palindrome
                if (hashLeft == hashRight) {
                    result[1]++;
                    palindrome[i][j] = 1;
                    if(palindrome[i][i + len - 1] > 0) {
                        palindrome[j - len + 1][j] = palindrome[i][i + len - 1];
                        palindrome[i][j] += palindrome[j - len + 1][j];
                        for (int k = 2; k <=palindrome[i][j]; k++) {
                            result[k]++;
                        }
                    }
                }
            }
        }
        for (int i=1; i < result.length; i++) {
            System.out.print(result[i] + " ");
        }
        System.out.println();
    }
}