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.Scanner;

public class Main {
    static final int P = 311;
    // we use two mods to reduce the chance of collision
    static final int MOD1 = (int) (1e9 + 7);
    static final int MOD2 = (int) (1e9 + 9);

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int n = s.length();

        // Pre-compute
        int[] power1 = new int[n + 1];
        int[] power2 = new int[n + 1];
        int[] modInv1 = new int[n + 1];
        int[] modInv2 = new int[n + 1];
        power1[0] = 1;
        power2[0] = 1;
        modInv1[0] = 1;
        modInv2[0] = 1;

        for (int i = 1; i <= n; i++) {
            power1[i] = (int) (1L * power1[i - 1] * P % MOD1);
            power2[i] = (int) (1L * power2[i - 1] * P % MOD2);
            modInv1[i] = binExp(power1[i], MOD1 - 2, MOD1);
            modInv2[i] = binExp(power2[i], MOD2 - 2, MOD2);
        }

        // Compute hash values
        long hash1 = 0;
        long hash2 = 0;
        int[] forwardHash1 = new int[n + 1];
        int[] forwardHash2 = new int[n + 1];

        for (int i = 1; i <= n; i++) {
            hash1 += 1L * s.charAt(i - 1) * power1[i];
            hash2 += 1L * s.charAt(i - 1) * power2[i];
            hash1 %= MOD1;
            hash2 %= MOD2;
            forwardHash1[i] = (int) hash1;
            forwardHash2[i] = (int) hash2;
        }

        hash1 = 0;
        hash2 = 0;
        int[] backwardHash1 = new int[n + 1];
        int[] backwardHash2 = new int[n + 1];

        for (int i = 1; i <= n; i++) {
            hash1 += 1L * s.charAt(n - i) * power1[i];
            hash2 += 1L * s.charAt(n - i) * power2[i];
            hash1 %= MOD1;
            hash2 %= MOD2;
            backwardHash1[i] = (int) hash1;
            backwardHash2[i] = (int) hash2;
        }

        int[][] dp = new int[n + 1][n + 1];
        int[] count = new int[n + 1];

        for (int subLen = 1; subLen <= n; subLen++) {
            for (int left = 0; left <= n - subLen; left++) {
                int right = left + subLen - 1;

                if (subLen == 1) {
                    dp[left][left] = 1;
                }
                else if (subLen == 2) {
                    if (s.charAt(left) == s.charAt(right)) {
                        dp[left][right] = 2;
                    }
                }
                else {
                    int fh1 = GetForwardHash(forwardHash1, modInv1, left, right, MOD1);
                    int fh2 = GetForwardHash(forwardHash2, modInv2, left, right, MOD2);
                    int bh1 = GetBackwardHash(backwardHash1, modInv1, n, left, right, MOD1);
                    int bh2 = GetBackwardHash(backwardHash2, modInv2, n, left, right, MOD2);
                    if (fh1 == bh1 && fh2 == bh2) {
                        dp[left][right] = dp[left][left + subLen / 2 - 1] + 1;
                    }
                }

                count[dp[left][right]]++;
            }
        }

        for (int i = n - 1; i >= 1; i--) {
            count[i] += count[i + 1];
        }

        for (int i = 1; i <= n; i++) {
            System.out.print(count[i]);
            System.out.print(' ');
        }

        System.out.print('\n');
    }

    static int binExp(long a, long x, int mod) {
        long res = 1;

        while (x > 0) {
            if ((x & 1) != 0) {
                res *= a;
                res %= mod;
            }

            a *= a;
            a %= mod;
            x >>= 1;
        }

        return (int) res;
    }

    static int GetForwardHash(int[] forwardHash, int[] modInv, int left, int right, int mod) {
        return (int) (1L * (forwardHash[right + 1] - forwardHash[left] + mod) * modInv[left] % mod);
    }

    static int GetBackwardHash(int[] backwardHash, int[] modInv, int n, int left, int right, int mod) {
        int rLeft = n - left - 1;
        int rRight = n - right - 1;
        return (int) (1L * (backwardHash[rLeft + 1] - backwardHash[rRight] + mod) * modInv[rRight] % mod);
    }
}