#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000010;
int n, s2[maxn], ch[maxn], fail[maxn], len[maxn], cnt, last, chang, id[maxn],
    s[maxn], cur, fa[maxn];
int head[maxn], to[maxn], nextt[maxn], tot = 1, w[maxn];
char t[maxn];
int find2(int x) {
  if (s[cur - len[x] - 1] == s[cur]) return x;
  return find2(fail[x]);
}
void add(int x, int y, int z) {
  w[tot] = z;
  to[tot] = y;
  nextt[tot] = head[x];
  head[x] = tot++;
}
int getson(int u, int x) {
  for (int i = head[u]; i; i = nextt[i])
    if (w[i] == x) return to[i];
  return 0;
}
void insert(int x) {
  s[++cur] = x;
  last = find2(last);
  if (!getson(last, x)) {
    ++cnt;
    fail[cnt] = getson(find2(fail[last]), x);
    len[cnt] = len[last] + 2;
    add(last, cnt, x);
  }
  last = getson(last, x);
}
int find(int x) {
  if (x == fa[x]) return x;
  return fa[x] = find(fa[x]);
}
int main() {
  scanf("%d", &n);
  scanf("%s", t + 1);
  for (int i = 1, j = n; i <= n; i++, j--)
    s2[++chang] = t[i] - 'a', s2[++chang] = t[j] - 'a';
  memset(s, -1, sizeof(s));
  n *= 2;
  len[1] = -1;
  fail[0] = fail[1] = 1;
  cnt = last = 1;
  for (int i = 1; i <= n; i++) insert(s2[i]), id[i] = last;
  for (int i = 0; i <= cnt; i++) fa[i] = i;
  int tn = n / 2;
  for (int i = 1; i <= (tn + 1) / 2; i++) {
    int x = find(id[n - (i - 1) * 2]);
    while (x != 1 && (len[x] / 2 >= tn - (i - 1) * 2 || len[x] % 4 != 2))
      x = fa[x] = find(fail[fa[x]]);
    if (len[x] % 4 != 2)
      printf("%d ", -1);
    else
      printf("%d ", len[x] / 2);
  }
  return 0;
}

### Prompt

Please create a solution in CPP to 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>
using namespace std;
const int maxn = 2000010;
int n, s2[maxn], ch[maxn], fail[maxn], len[maxn], cnt, last, chang, id[maxn],
    s[maxn], cur, fa[maxn];
int head[maxn], to[maxn], nextt[maxn], tot = 1, w[maxn];
char t[maxn];
int find2(int x) {
  if (s[cur - len[x] - 1] == s[cur]) return x;
  return find2(fail[x]);
}
void add(int x, int y, int z) {
  w[tot] = z;
  to[tot] = y;
  nextt[tot] = head[x];
  head[x] = tot++;
}
int getson(int u, int x) {
  for (int i = head[u]; i; i = nextt[i])
    if (w[i] == x) return to[i];
  return 0;
}
void insert(int x) {
  s[++cur] = x;
  last = find2(last);
  if (!getson(last, x)) {
    ++cnt;
    fail[cnt] = getson(find2(fail[last]), x);
    len[cnt] = len[last] + 2;
    add(last, cnt, x);
  }
  last = getson(last, x);
}
int find(int x) {
  if (x == fa[x]) return x;
  return fa[x] = find(fa[x]);
}
int main() {
  scanf("%d", &n);
  scanf("%s", t + 1);
  for (int i = 1, j = n; i <= n; i++, j--)
    s2[++chang] = t[i] - 'a', s2[++chang] = t[j] - 'a';
  memset(s, -1, sizeof(s));
  n *= 2;
  len[1] = -1;
  fail[0] = fail[1] = 1;
  cnt = last = 1;
  for (int i = 1; i <= n; i++) insert(s2[i]), id[i] = last;
  for (int i = 0; i <= cnt; i++) fa[i] = i;
  int tn = n / 2;
  for (int i = 1; i <= (tn + 1) / 2; i++) {
    int x = find(id[n - (i - 1) * 2]);
    while (x != 1 && (len[x] / 2 >= tn - (i - 1) * 2 || len[x] % 4 != 2))
      x = fa[x] = find(fail[fa[x]]);
    if (len[x] % 4 != 2)
      printf("%d ", -1);
    else
      printf("%d ", len[x] / 2);
  }
  return 0;
}

```