#include <bits/stdc++.h>
int n, cnt, r[4000010], pp[2000010], p[4000010], d[4000010], Ans[1000010],
    pre[4000010];
char f[4000010], s[1000010], t[2000010];
bool vis[4000010];
void Manacher() {
  int p = 1, mx = 1;
  r[1] = 1;
  for (int i = 1; i <= cnt; ++i) {
    r[i] = (mx - i + 1 < r[p * 2 - i] ? mx - i + 1 : r[p * 2 - i]);
    while (f[i - r[i]] == f[i + r[i]]) ++r[i];
    if (mx < i + r[i] - 1) {
      mx = i + r[i] - 1;
      p = i;
    }
  }
}
int main() {
  scanf("%d %s", &n, s + 1);
  for (int i = 1; i <= n; ++i) {
    t[++cnt] = s[i];
    pp[cnt] = i;
    t[++cnt] = s[n - i + 1];
  }
  cnt = 0;
  f[0] = '$';
  int pos;
  for (int i = 1; i <= n + n; ++i) {
    f[++cnt] = t[i];
    if (i == n) pos = cnt;
    p[cnt] = pp[i];
    f[++cnt] = '#';
    if (i & 1) vis[cnt] = 1;
  }
  f[++cnt] = '~';
  Manacher();
  for (int i = 1; i <= pos; ++i) pre[i] = pre[i - 1] + (f[i] == '#');
  for (int i = 1; i <= pos; ++i)
    if (vis[i]) {
      d[i - r[i] + 1] = i;
    }
  for (int i = 1; i <= pos; ++i) {
    if (d[i] == 0 && d[i - 1] >= i)
      d[i] = d[i - 1];
    else if (d[i - 1] > d[i])
      d[i] = d[i - 1];
    if (p[i]) {
      if (d[i] == 0)
        Ans[p[i]] = -1;
      else {
        Ans[p[i]] = d[i] - (i - 1) - (pre[d[i]] - pre[i - 1]);
      }
    }
  }
  for (int i = 1; i <= n + 1 >> 1; ++i) printf("%d ", Ans[i]);
  return 0;
}

### Prompt

Construct a cpp code solution to the problem outlined:

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>
int n, cnt, r[4000010], pp[2000010], p[4000010], d[4000010], Ans[1000010],
    pre[4000010];
char f[4000010], s[1000010], t[2000010];
bool vis[4000010];
void Manacher() {
  int p = 1, mx = 1;
  r[1] = 1;
  for (int i = 1; i <= cnt; ++i) {
    r[i] = (mx - i + 1 < r[p * 2 - i] ? mx - i + 1 : r[p * 2 - i]);
    while (f[i - r[i]] == f[i + r[i]]) ++r[i];
    if (mx < i + r[i] - 1) {
      mx = i + r[i] - 1;
      p = i;
    }
  }
}
int main() {
  scanf("%d %s", &n, s + 1);
  for (int i = 1; i <= n; ++i) {
    t[++cnt] = s[i];
    pp[cnt] = i;
    t[++cnt] = s[n - i + 1];
  }
  cnt = 0;
  f[0] = '$';
  int pos;
  for (int i = 1; i <= n + n; ++i) {
    f[++cnt] = t[i];
    if (i == n) pos = cnt;
    p[cnt] = pp[i];
    f[++cnt] = '#';
    if (i & 1) vis[cnt] = 1;
  }
  f[++cnt] = '~';
  Manacher();
  for (int i = 1; i <= pos; ++i) pre[i] = pre[i - 1] + (f[i] == '#');
  for (int i = 1; i <= pos; ++i)
    if (vis[i]) {
      d[i - r[i] + 1] = i;
    }
  for (int i = 1; i <= pos; ++i) {
    if (d[i] == 0 && d[i - 1] >= i)
      d[i] = d[i - 1];
    else if (d[i - 1] > d[i])
      d[i] = d[i - 1];
    if (p[i]) {
      if (d[i] == 0)
        Ans[p[i]] = -1;
      else {
        Ans[p[i]] = d[i] - (i - 1) - (pre[d[i]] - pre[i - 1]);
      }
    }
  }
  for (int i = 1; i <= n + 1 >> 1; ++i) printf("%d ", Ans[i]);
  return 0;
}

```