import java.io.*;
import java.util.*;

public class army_pk {

	PrintWriter out;
	BufferedReader br;
	StringTokenizer st;

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

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

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

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

	public void solve() throws IOException {
		String s = nextToken();
		int[] z = new int[s.length()];
		
		z[0] = z.length;
		int l = 0;
		int r = 0;
		for (int i = 1; i < s.length(); i++) {
			z[i] = Math.min(r - i, z[i - l]);
			if (z[i] < 0)
				z[i] = 0;
			while ((i + z[i] < s.length()) && (s.charAt(i + z[i]) == s.charAt(z[i])))
				z[i]++;
			if (i + z[i] > r) {
				l = i;
				r = i + z[i];
			}
		}
		int t = 0;
		for (int i = 0; i < s.length(); i++) {
			while ((z[t] < (i - t) * 2 + 1) && (t < i)) {
				t++;
			}
			if (s.charAt(t) == s.charAt(0)) {
				out.print((Math.min(i - t, s.length() - 1 - i)) * 2 + 1);
			} else {
				out.print(0);
			}
			if (i < s.length() - 1)
				out.print(' ');
		}
		out.println();
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			br = new BufferedReader(new FileReader("army.in"));
			out = new PrintWriter("army.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new army_pk().run();
	}
}
