#include <bits/stdc++.h>
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += 1000000009;
}
inline void add(long long &a, long long b) {
  a += b;
  if (a >= 1000000009) a -= 1000000009;
}
template <typename T>
inline T const &MAX(T const &a, T const &b) {
  return a > b ? a : b;
}
template <typename T>
inline T const &MIN(T const &a, T const &b) {
  return a < b ? a : b;
}
inline long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000009;
    a = a * a % 1000000009, b >>= 1;
  }
  return ans;
}
inline long long qp(long long a, long long b, long long c) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % c;
    a = a * a % c, b >>= 1;
  }
  return ans;
}
using namespace std;
const unsigned long long ba = 233;
const double eps = 1e-5;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1000000 + 10, maxn = 1000000 + 10, inf = 0x3f3f3f3f;
char s[N];
int sa[N], t[N], t2[N], c[N], rk[N], height[N];
void buildSa(int n, int m) {
  int i, j = 0, k = 0, *x = t, *y = t2;
  for (i = 0; i < m; i++) c[i] = 0;
  for (i = 0; i < n; i++) c[x[i] = s[i]]++;
  for (i = 1; i < m; i++) c[i] += c[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--c[x[i]]] = i;
  for (int k = 1; k < n; k <<= 1) {
    int p = 0;
    for (i = n - k; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= k) y[p++] = sa[i] - k;
    for (i = 0; i < m; i++) c[i] = 0;
    for (i = 0; i < n; i++) c[x[y[i]]]++;
    for (i = 1; i < m; i++) c[i] += c[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--c[x[y[i]]]] = y[i];
    swap(x, y);
    p = 1;
    x[sa[0]] = 0;
    for (int i = 1; i < n; i++) {
      if (y[sa[i - 1]] == y[sa[i]] && y[sa[i - 1] + k] == y[sa[i] + k])
        x[sa[i]] = p - 1;
      else
        x[sa[i]] = p++;
    }
    if (p >= n) break;
    m = p;
  }
  for (i = 1; i < n; i++) rk[sa[i]] = i;
  for (i = 0; i < n - 1; i++) {
    if (k) k--;
    j = sa[rk[i] - 1];
    while (s[i + k] == s[j + k]) k++;
    height[rk[i]] = k;
  }
}
int Log[N];
struct ST {
  int dp[N][20], ty;
  ST() {
    for (int i = -(Log[0] = -1); i < N; i++)
      Log[i] = Log[i - 1] + ((i & (i - 1)) == 0);
  }
  void build(int n, int b[], int _ty) {
    ty = _ty;
    for (int i = 1; i <= n; i++) dp[i][0] = ty * b[i];
    for (int j = 1; j <= Log[n]; j++)
      for (int i = 1; i + (1 << j) - 1 <= n; i++)
        dp[i][j] = max(dp[i][j - 1], dp[i + (1 << (j - 1))][j - 1]);
  }
  int query(int x, int y) {
    int k = Log[y - x + 1];
    return ty * max(dp[x][k], dp[y - (1 << k) + 1][k]);
  }
} st;
int lcp(int x, int y) {
  x = rk[x], y = rk[y];
  if (x > y) swap(x, y);
  x++;
  return st.query(x, y);
}
int n;
struct sgt {
  int ma[N << 2], lazy[N << 2];
  sgt() {
    memset(ma, -1, sizeof ma);
    memset(lazy, -1, sizeof lazy);
  }
  void pushdown(int rt) {
    if (~lazy[rt]) {
      ma[rt << 1] = max(ma[rt << 1], lazy[rt]);
      ma[rt << 1 | 1] = max(ma[rt << 1 | 1], lazy[rt]);
      lazy[rt << 1] = max(lazy[rt << 1], lazy[rt]);
      lazy[rt << 1 | 1] = max(lazy[rt << 1 | 1], lazy[rt]);
      lazy[rt] = -1;
    }
  }
  void update(int L, int R, int v, int l, int r, int rt) {
    if (L <= l && r <= R) {
      ma[rt] = max(ma[rt], v);
      lazy[rt] = max(lazy[rt], v);
      return;
    }
    pushdown(rt);
    int m = (l + r) >> 1;
    if (L <= m) update(L, R, v, l, m, rt << 1);
    if (m < R) update(L, R, v, m + 1, r, rt << 1 | 1);
    ma[rt] = max(ma[rt << 1], ma[rt << 1 | 1]);
  }
  int query(int pos, int l, int r, int rt) {
    if (l == r) {
      if (ma[rt] == -1)
        return -1;
      else
        return (ma[rt] - l) * 2 + 1;
    }
    pushdown(rt);
    int m = (l + r) >> 1;
    if (pos <= m)
      return query(pos, l, m, rt << 1);
    else
      return query(pos, m + 1, r, rt << 1 | 1);
  }
} sg;
int main() {
  scanf("%d%s", &n, s);
  buildSa(n + 1, 256);
  st.build(n, height, -1);
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) continue;
    int l = 0, r = i + 1;
    while (l < r - 1) {
      int m = (l + r) >> 1;
      if (lcp(i - m, n - i - 1 - m) >= 2 * m + 1)
        l = m;
      else
        r = m;
    }
    sg.update(i - l, i, i, 0, n - 1, 1);
  }
  for (int i = 0; i < (n + 1) / 2; i++) printf("%d ", sg.query(i, 0, n - 1, 1));
  puts("");
  return 0;
}

### Prompt

Create a solution in CPP for the following problem:

You are given a string s consisting of n lowercase Latin letters.

Let's denote k-substring of s as a string subsk = sksk + 1..sn + 1 - k. Obviously, subs1 = s, and there are exactly <image> such substrings.

Let's call some string t an odd proper suprefix of a string T iff the following conditions are met:

  * |T| > |t|; 
  * |t| is an odd number; 
  * t is simultaneously a prefix and a suffix of T.



For evey k-substring (<image>) of s you have to calculate the maximum length of its odd proper suprefix.

Input

The first line contains one integer n (2 ≤ n ≤ 106) — the length s.

The second line contains the string s consisting of n lowercase Latin letters.

Output

Print <image> integers. i-th of them should be equal to maximum length of an odd proper suprefix of i-substring of s (or  - 1, if there is no such string that is an odd proper suprefix of i-substring).

Examples

Input

15
bcabcabcabcabca


Output

9 7 5 3 1 -1 -1 -1


Input

24
abaaabaaaabaaabaaaabaaab


Output

15 13 11 9 7 5 3 1 1 -1 -1 1


Input

19
cabcabbcabcabbcabca


Output

5 3 1 -1 -1 1 1 -1 -1 -1

Note

The answer for first sample test is folowing: 

  * 1-substring: bcabcabcabcabca
  * 2-substring: cabcabcabcabc
  * 3-substring: abcabcabcab
  * 4-substring: bcabcabca
  * 5-substring: cabcabc
  * 6-substring: abcab 
  * 7-substring: bca 
  * 8-substring: c 

### Response

```cpp
#include <bits/stdc++.h>
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += 1000000009;
}
inline void add(long long &a, long long b) {
  a += b;
  if (a >= 1000000009) a -= 1000000009;
}
template <typename T>
inline T const &MAX(T const &a, T const &b) {
  return a > b ? a : b;
}
template <typename T>
inline T const &MIN(T const &a, T const &b) {
  return a < b ? a : b;
}
inline long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000009;
    a = a * a % 1000000009, b >>= 1;
  }
  return ans;
}
inline long long qp(long long a, long long b, long long c) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % c;
    a = a * a % c, b >>= 1;
  }
  return ans;
}
using namespace std;
const unsigned long long ba = 233;
const double eps = 1e-5;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1000000 + 10, maxn = 1000000 + 10, inf = 0x3f3f3f3f;
char s[N];
int sa[N], t[N], t2[N], c[N], rk[N], height[N];
void buildSa(int n, int m) {
  int i, j = 0, k = 0, *x = t, *y = t2;
  for (i = 0; i < m; i++) c[i] = 0;
  for (i = 0; i < n; i++) c[x[i] = s[i]]++;
  for (i = 1; i < m; i++) c[i] += c[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--c[x[i]]] = i;
  for (int k = 1; k < n; k <<= 1) {
    int p = 0;
    for (i = n - k; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= k) y[p++] = sa[i] - k;
    for (i = 0; i < m; i++) c[i] = 0;
    for (i = 0; i < n; i++) c[x[y[i]]]++;
    for (i = 1; i < m; i++) c[i] += c[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--c[x[y[i]]]] = y[i];
    swap(x, y);
    p = 1;
    x[sa[0]] = 0;
    for (int i = 1; i < n; i++) {
      if (y[sa[i - 1]] == y[sa[i]] && y[sa[i - 1] + k] == y[sa[i] + k])
        x[sa[i]] = p - 1;
      else
        x[sa[i]] = p++;
    }
    if (p >= n) break;
    m = p;
  }
  for (i = 1; i < n; i++) rk[sa[i]] = i;
  for (i = 0; i < n - 1; i++) {
    if (k) k--;
    j = sa[rk[i] - 1];
    while (s[i + k] == s[j + k]) k++;
    height[rk[i]] = k;
  }
}
int Log[N];
struct ST {
  int dp[N][20], ty;
  ST() {
    for (int i = -(Log[0] = -1); i < N; i++)
      Log[i] = Log[i - 1] + ((i & (i - 1)) == 0);
  }
  void build(int n, int b[], int _ty) {
    ty = _ty;
    for (int i = 1; i <= n; i++) dp[i][0] = ty * b[i];
    for (int j = 1; j <= Log[n]; j++)
      for (int i = 1; i + (1 << j) - 1 <= n; i++)
        dp[i][j] = max(dp[i][j - 1], dp[i + (1 << (j - 1))][j - 1]);
  }
  int query(int x, int y) {
    int k = Log[y - x + 1];
    return ty * max(dp[x][k], dp[y - (1 << k) + 1][k]);
  }
} st;
int lcp(int x, int y) {
  x = rk[x], y = rk[y];
  if (x > y) swap(x, y);
  x++;
  return st.query(x, y);
}
int n;
struct sgt {
  int ma[N << 2], lazy[N << 2];
  sgt() {
    memset(ma, -1, sizeof ma);
    memset(lazy, -1, sizeof lazy);
  }
  void pushdown(int rt) {
    if (~lazy[rt]) {
      ma[rt << 1] = max(ma[rt << 1], lazy[rt]);
      ma[rt << 1 | 1] = max(ma[rt << 1 | 1], lazy[rt]);
      lazy[rt << 1] = max(lazy[rt << 1], lazy[rt]);
      lazy[rt << 1 | 1] = max(lazy[rt << 1 | 1], lazy[rt]);
      lazy[rt] = -1;
    }
  }
  void update(int L, int R, int v, int l, int r, int rt) {
    if (L <= l && r <= R) {
      ma[rt] = max(ma[rt], v);
      lazy[rt] = max(lazy[rt], v);
      return;
    }
    pushdown(rt);
    int m = (l + r) >> 1;
    if (L <= m) update(L, R, v, l, m, rt << 1);
    if (m < R) update(L, R, v, m + 1, r, rt << 1 | 1);
    ma[rt] = max(ma[rt << 1], ma[rt << 1 | 1]);
  }
  int query(int pos, int l, int r, int rt) {
    if (l == r) {
      if (ma[rt] == -1)
        return -1;
      else
        return (ma[rt] - l) * 2 + 1;
    }
    pushdown(rt);
    int m = (l + r) >> 1;
    if (pos <= m)
      return query(pos, l, m, rt << 1);
    else
      return query(pos, m + 1, r, rt << 1 | 1);
  }
} sg;
int main() {
  scanf("%d%s", &n, s);
  buildSa(n + 1, 256);
  st.build(n, height, -1);
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) continue;
    int l = 0, r = i + 1;
    while (l < r - 1) {
      int m = (l + r) >> 1;
      if (lcp(i - m, n - i - 1 - m) >= 2 * m + 1)
        l = m;
      else
        r = m;
    }
    sg.update(i - l, i, i, 0, n - 1, 1);
  }
  for (int i = 0; i < (n + 1) / 2; i++) printf("%d ", sg.query(i, 0, n - 1, 1));
  puts("");
  return 0;
}

```