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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class cfkk {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long p = 31l;
		long[] p_pow = new long[s.length()];
		p_pow[0] = 1;
		for (int i = 1; i < s.length(); i++)
			p_pow[i] = p_pow[i - 1] * p;
		long[] H = new long[s.length()];
		for (int i = 0; i < s.length(); i++) {
			H[i] += (s.charAt(i) - 'a' + 1) * p_pow[i];
			if (i != 0)
				H[i] += H[i - 1];
		}
		boolean[][] pal = new boolean[s.length()][s.length()];
		for (int i = s.length() - 1; i >= 0; i--) {
			for (int l = 1; l + i - 1 < s.length(); l++) {
				if (s.charAt(i) == s.charAt(i + l - 1) && (l < 3 || pal[i + 1][i + l - 2])) {
					pal[i][i + l - 1] = true;
				}
			}
		}
		int[][] k = new int[s.length()][s.length()];
		for (int[] a : k)
			Arrays.fill(a, -(2 * s.length()));
		int[] res = new int[s.length()];
		for (int l = 1; l <= s.length(); l++) {
			for (int i = 0; i + l - 1 < s.length(); i++) {
				int j = i + l - 1;
				if (pal[i][j])
					k[i][j] = 0;
				if (l > 1) {
					int len = l / 2;
					long hi = H[i + len - 1] - (i != 0 ? H[i - 1] : 0);
					long hj = H[j] - H[j - len];
					if (hi * p_pow[j - len + 1 - i] == hj)
						k[i][j] = Math.max(k[i][j], Math.min(k[i][i + len - 1], k[j - len + 1][j]) + 1);
				}
				if (k[i][j] >= 0)
					res[k[i][j]]++;
			}
		}
		for (int i = res.length - 2; i >= 0; i--) {
			res[i] += res[i + 1];
		}
		PrintWriter out = new PrintWriter(System.out);
		for (int i = 0; i < res.length; i++)
			out.print(res[i] + " ");
		out.close();

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String f) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(f));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public int[] nextIntArray1(int n) throws IOException {
			int[] a = new int[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextInt();
			return a;
		}

		public int[] shuffle(int[] a, int n) {
			int[] b = new int[n];
			for (int i = 0; i < n; i++)
				b[i] = a[i];
			Random r = new Random();
			for (int i = 0; i < n; i++) {
				int j = i + r.nextInt(n - i);
				int t = b[i];
				b[i] = b[j];
				b[j] = t;
			}
			return b;
		}

		public int[] nextIntArraySorted(int n) throws IOException {
			int[] a = nextIntArray(n);
			a = shuffle(a, n);
			Arrays.sort(a);
			return a;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public long[] nextLongArray1(int n) throws IOException {
			long[] a = new long[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextLong();
			return a;
		}

		public long[] nextLongArraySorted(int n) throws IOException {
			long[] a = nextLongArray(n);
			Random r = new Random();
			for (int i = 0; i < n; i++) {
				int j = i + r.nextInt(n - i);
				long t = a[i];
				a[i] = a[j];
				a[j] = t;
			}
			Arrays.sort(a);
			return a;
		}
	}

}