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:
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        new Main().run(in, out);
        out.close();
    }

    public static long mod = 17352642619633L;
    static long p = 31;

    char[] ca;
    int N;
    void run(FastScanner in, PrintWriter out) {
        ca = in.next().toCharArray();
        N = ca.length;

        int[][] K = new int[N][N];
        // boolean[][] isPalindrome = new boolean[N][N];

        // for (int len = 1; len <= N; len++) {
        //     for (int l = 0, r = len-1; r < N; l++, r++) {

        //         if (len == 1) {
        //             isPalindrome[l][r] = true;
        //         } else if (len == 2) {
        //             isPalindrome[l][r] = ca[l] == ca[r];
        //         } else {
        //             isPalindrome[l][r] = ca[l] == ca[r]
        //                 && isPalindrome[l+1][r-1];
        //         }
        //     }
        // }

        for (int[] k : K) Arrays.fill(k, -1);

        hash = new long[N+1];
        long h = 0;
        for (int i = 0; i < N; i++) {
            h = (h*p) + (ca[i]-'a'+1);
            hash[i+1] = h;
        }

        int[] ret = new int[N];
        for (int len = 1; len <= N; len++) {
            for (int l = 0, r = len-1; r < N; l++, r++) {

                if (len == 1) {
                    ret[0]++;
                    K[l][r] = 1;
                } else if (len == 2) {
                    if (ca[l] == ca[r]) {
                        ret[1]++;
                        K[l][r] = 2;
                    }
                } else {

                    int l1 = l; int r1 = l+len/2-1;
                    int l2 = r-(len/2)+1; int r2 = r;
                    // if (len == 2) {
                    //     System.out.println(l1 + " " + r1 + " " + l2 + " " + r2);
                    //     System.out.println(hashBetween(l1, r1));
                    //     System.out.println(hashBetween(l2, r2));
                    // }
                    if (K[l1][r1] != -1
                            && K[l2][r2] != -1
                            && hashBetween(l1, r1) == hashBetween(l2, r2)) {

                        K[l][r] = K[l1][r1]+1;
                        ret[K[l][r]-1]++;
                    }

                    if (ca[l] == ca[r] && K[l][r] == -1 && K[l+1][r-1] != -1) {
                        K[l][r] = 1;
                        ret[0]++;
                    }

                }
            }
        }

        for (int i = N-2; i >= 0; i--) {
            ret[i] += ret[i+1];
        }

        for (int x : ret) {
            out.print(x + " ");
        }
        out.println();


    }

    long[] hash;
    static long[] pPow = new long[5005];
    static {
        pPow[0] = 1;
        for (int i = 1; i < pPow.length; i++) {
            pPow[i] = pPow[i-1] * p;
        }
    }

    long hashBetween(int l, int r) {
        return hash[r+1]-hash[l]*pPow[r-l+1];
    }



    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}