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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Random;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD
    {
        Hashing hash;
        Hashing rev_hash;
        int n;

        public void solve(int testNumber, InputReader in, OutputWriter out)
        {
            String s = in.readString();
            String srev = StringUtils.reverse(s);
            n = s.length();
            hash = new Hashing(s);
            rev_hash = new Hashing(srev);
            HashMap<Long, Integer> hm = new HashMap<Long, Integer>();
            int[] ctr = new int[n + 2];
            for (int i = 0; i < n; i++)
            {
                //(j,j+i)
                for (int j = 0; j < (n - i); j++)
                {
//                MiscUtils.debug1(s.substring(j,j+i+1)+" * "+getHash(j,j+i)+" * "+getReverseHash(j,j+i));
                    if (i % 2 == 0)
                    {
                        long h = getHash(j, i + j);
                        long hr = getReverseHash(j, i + j);
                        long hash1 = getHash(j, (2 * j + i) / 2 - 1);
                        long hash2 = getHash((2 * j + i) / 2 + 1, j + i);
                        int v1 = -1;
                        int v2 = -1;
                        if (hm.containsKey(hash1))
                        {
                            v1 = hm.get(hash1);
                        }
                        if (hm.containsKey(hash2))
                        {
                            v2 = hm.get(hash2);
                        }
                        if (v1 == v2 && v1 != -1 && (h == hr))
                        {
                            hm.put(h, v1 + 1);
                            ctr[v1 + 1]++;
                        } else if (h == hr)
                        {
                            hm.put(h, 1);
                            ctr[1]++;
                        }
                    } else
                    {
                        long h = getHash(j, i + j);
                        long hr = getReverseHash(j, i + j);
                        long hash1 = getHash(j, (2 * j + i) / 2);
                        long hash2 = getHash((2 * j + i) / 2 + 1, j + i);
                        int v1 = -1;
                        int v2 = -1;
                        if (hm.containsKey(hash1))
                        {
                            v1 = hm.get(hash1);
                        }
                        if (hm.containsKey(hash2))
                        {
                            v2 = hm.get(hash2);
                        }
                        if (v1 == v2 && v1 != -1 && (h == hr))
                        {
                            hm.put(h, v1 + 1);
                            ctr[v1 + 1]++;
                        } else if (h == hr)
                        {
                            hm.put(h, 1);
                            ctr[1]++;
                        }
                    }
                }
            }
//        out.printLine(getHash(4,4));
//        out.printLine(hm);
            for (int i = n; i >= 1; i--)
            {
                ctr[i] = ctr[i] + ctr[i + 1];
            }
            for (int i = 1; i <= n; i++)
            {
                out.print(ctr[i] + " ");
            }
            out.printLine();
        }

        long getHash(int i, int j)
        {
            return hash.getHash(i, j - i + 1);
        }

        long getReverseHash(int i, int j)
        {
            return rev_hash.getHash(n - 1 - j, (j - i + 1));
        }

    }

    static class OutputWriter
    {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream)
        {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer)
        {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects)
        {
            for (int i = 0; i < objects.length; i++)
            {
                if (i != 0)
                {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine()
        {
            writer.println();
        }

        public void close()
        {
            writer.close();
        }

    }

    static class Hashing
    {
        static final int multiplier = 43;
        static final Random rnd = new Random();
        static final int mod1 = BigInteger.valueOf((int) (1e9 + rnd.nextInt((int) 1e9))).nextProbablePrime().intValue();
        static final int invMultiplier1 = BigInteger.valueOf(multiplier).modInverse(BigInteger.valueOf(mod1)).intValue();
        long[] hash1;
        long[] inv1;
        int n;

        public Hashing(String s)
        {
            n = s.length();
            hash1 = new long[n + 1];
            inv1 = new long[n + 1];
            inv1[0] = 1;
            long p1 = 1;
            for (int i = 0; i < n; i++)
            {
                hash1[i + 1] = (hash1[i] + s.charAt(i) * p1) % mod1;
                p1 = p1 * multiplier % mod1;
                inv1[i + 1] = inv1[i] * invMultiplier1 % mod1;
            }
        }

        public long getHash(int i, int len)
        {
            return (((hash1[i + len] - hash1[i] + mod1) * inv1[i] % mod1));
        }

    }

    static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars == -1)
            {
                throw new InputMismatchException();
            }
            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                } catch (IOException e)
                {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
            {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do
            {
                if (Character.isValidCodePoint(c))
                {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
            {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c)
        {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);

        }

    }

    static class StringUtils
    {
        public static String reverse(String sample)
        {
            StringBuilder result = new StringBuilder(sample);
            result.reverse();
            return result.toString();
        }

    }
}