#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int base[2] = {31, 33};
int pw[2][1000005], a[2][1000005];
char s[1000005];
int n, ans[1000005];
bool func(int x, int y, int xx, int yy) {
  for (int i = 0; i <= 1; i++) {
    if (((a[i][y] - 1ll * a[i][x - 1] * pw[i][y - x + 1]) % mod + mod) % mod !=
        ((a[i][yy] - 1ll * a[i][xx - 1] * pw[i][yy - xx + 1]) % mod + mod) %
            mod)
      return 0;
  }
  return 1;
}
int main() {
  scanf("%d %s", &n, s + 1);
  for (int i = 0; i <= 1; i++) {
    pw[i][0] = 1;
    for (int j = 1; j < 1000005; j++)
      pw[i][j] = 1ll * pw[i][j - 1] * base[i] % mod;
    for (int j = 1; j <= n; j++)
      a[i][j] = (1ll * a[i][j - 1] * base[i] + s[j] - 'a') % mod;
  }
  int l, r;
  int up = (n + 1) / 2;
  ans[up + 1] = -1;
  for (int k = up; k; k--) {
    l = k, r = n - k + 1;
    ans[k] = ans[k + 1] + 2;
    while (ans[k] >= r - l + 1) ans[k] -= 2;
    while (ans[k] > 0) {
      if (func(l, l + ans[k] - 1, r - ans[k] + 1, r)) break;
      ans[k] -= 2;
    }
  }
  for (int i = 1; i <= up; i++) printf("%d ", ans[i]);
}
