#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e6 + 50;
const int INF = 0x3f3f3f3f;
int len[MAXN], fail[MAXN], nxt[MAXN][26];
int last, tot;
int id[MAXN], pre[MAXN];
char ss[MAXN], s[MAXN];
inline void Init() {
  len[0] = 0, len[1] = -1;
  fail[0] = fail[1] = 1;
  last = tot = 1;
}
inline void Insert(int x, int en) {
  int p = last;
  while (s[en] != s[en - len[p] - 1]) p = fail[p];
  if (!nxt[p][x]) {
    int np = ++tot;
    len[np] = len[p] + 2;
    int tmp = fail[p];
    while (s[en] != s[en - len[tmp] - 1]) tmp = fail[tmp];
    fail[np] = nxt[tmp][x];
    nxt[p][x] = np;
  }
  last = nxt[p][x];
  id[en] = last;
}
int Find(int x) { return x == pre[x] ? pre[x] : pre[x] = Find(pre[x]); }
int main() {
  int n, k = 0;
  scanf("%d", &n);
  scanf("%s", ss);
  Init();
  for (int i = 0, j = n - 1; i < n; i++, j--) s[++k] = ss[i], s[++k] = ss[j];
  for (int i = 1; i <= k; i++) Insert(s[i] - 'a', i);
  for (int i = 0; i <= tot; i++) pre[i] = i;
  for (int i = 1; i <= (n + 1) / 2; i++) {
    int x = Find(id[k - ((i - 1) << 1)]);
    while (x != 1 && ((len[x] >> 1) >= (n - ((i - 1) << 1)) || len[x] % 4 != 2))
      x = pre[x] = Find(fail[pre[x]]);
    printf("%d ", (len[x] % 4 == 2 ? (len[x] >> 1) : -1));
  }
  return 0;
}

### Prompt

Develop a solution in cpp to the problem described below:

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>
using namespace std;
const int MAXN = 2e6 + 50;
const int INF = 0x3f3f3f3f;
int len[MAXN], fail[MAXN], nxt[MAXN][26];
int last, tot;
int id[MAXN], pre[MAXN];
char ss[MAXN], s[MAXN];
inline void Init() {
  len[0] = 0, len[1] = -1;
  fail[0] = fail[1] = 1;
  last = tot = 1;
}
inline void Insert(int x, int en) {
  int p = last;
  while (s[en] != s[en - len[p] - 1]) p = fail[p];
  if (!nxt[p][x]) {
    int np = ++tot;
    len[np] = len[p] + 2;
    int tmp = fail[p];
    while (s[en] != s[en - len[tmp] - 1]) tmp = fail[tmp];
    fail[np] = nxt[tmp][x];
    nxt[p][x] = np;
  }
  last = nxt[p][x];
  id[en] = last;
}
int Find(int x) { return x == pre[x] ? pre[x] : pre[x] = Find(pre[x]); }
int main() {
  int n, k = 0;
  scanf("%d", &n);
  scanf("%s", ss);
  Init();
  for (int i = 0, j = n - 1; i < n; i++, j--) s[++k] = ss[i], s[++k] = ss[j];
  for (int i = 1; i <= k; i++) Insert(s[i] - 'a', i);
  for (int i = 0; i <= tot; i++) pre[i] = i;
  for (int i = 1; i <= (n + 1) / 2; i++) {
    int x = Find(id[k - ((i - 1) << 1)]);
    while (x != 1 && ((len[x] >> 1) >= (n - ((i - 1) << 1)) || len[x] % 4 != 2))
      x = pre[x] = Find(fail[pre[x]]);
    printf("%d ", (len[x] % 4 == 2 ? (len[x] >> 1) : -1));
  }
  return 0;
}

```