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

public class Main {

    int min(int a, int b) {
        if (a >= b) {
            return b;
        }
        return a;
    }

    char s[];
    int n;

    public void solve() throws IOException {
        s = nextToken().toCharArray();
        n = s.length;
        int d1[] = new int[n], d2[] = new int[n];
        int l = 0, r = -1, k;
        for (int i = 0; i < n; i++) {
            if (i > r) k = 1;
            else k = min(d1[l + r - i], r - i);

            while (0 <= i - k && i + k < n && s[i - k] == s[i + k]) k++;
            d1[i] = k;
            if (i + k - 1 > r) {
                r = i + k - 1;
                l = i - k + 1;
            }
        }
        l = 0;
        r = -1;
        for (int i = 0; i < n; i++) {
            if (i > r) k = 0;
            else k = min(d2[l + r - i + 1], r - i + 1);

            while (i + k < n && i - k - 1 >= 0 && s[i + k] == s[i - k - 1]) k++;
            d2[i] = k;

            if (i + k - 1 > r) {
                l = i - k;
                r = i + k - 1;
            }
        }
        int res[] = new int[n + 1];
        res[0] += n;
        int d[][] = new int[n][n];
        for (int i = 0; i < n; i++) {
            d[i][i] = 1;
        }
        for (int len = 2; len <= n; len++) {
            for(int i = 0; i < n - len + 1; i++){
                if(len % 2 == 0){
                    if(d2[i + len/2] >= len/2){
                        int min = n + 1;
                        min = min(min, d[i][i + len/2 - 1]);
                        min = min(min, d[i + len/2][i + len - 1]);
                        for(int j = 0; j <= min; j++){
                            res[j]++;
                        }
                        d[i][i + len - 1] = min + 1;
                    }
                }else{
                    if(d1[i + len/2] >= len/2 + 1){
                        int min = n + 1;
                        min = min(min, d[i][i + len/2 - 1]);
                        min = min(min, d[i + len/2 + 1][i + len - 1]);
                        for(int j = 0; j <= min; j++){
                            res[j]++;
                        }
                        d[i][i + len - 1] = min + 1;
                    }
                }
            }
        }

        for (int i = 0; i < n; i++) {
            out.print(res[i] + " ");
        }


    }


    BufferedReader br;
    StringTokenizer sc;
    PrintWriter out;

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new Main().run();
    }

    void run() throws IOException {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
//            br = new BufferedReader(new FileReader("sum2.in"));
//            out = new PrintWriter(new File("sum2.out"));
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    String nextToken() throws IOException {
        while (sc == null || !sc.hasMoreTokens()) {
            try {
                sc = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return sc.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
}