#include <bits/stdc++.h>
using namespace std;
int n;
char ch[2000200];
int has[2000200], pw[2000200];
unsigned long long _has[2000200], _pw[2000200];
int geth(int x, int y) {
  return (has[y] - 1ll * has[x - 1] * pw[y - x + 1] % 1000000007 + 1000000007) %
         1000000007;
}
unsigned long long _geth(int x, int y) {
  return _has[y] - _has[x - 1] * _pw[y - x + 1];
}
int st[2000200], top;
int main() {
  scanf("%d%s", &n, ch + 1);
  pw[0] = _pw[0] = 1;
  for (int i = 1; i <= n; i++)
    has[i] = (1ll * has[i - 1] * 173 % 1000000007 + ch[i]) % 1000000007,
    _has[i] = _has[i - 1] * 127 + ch[i],
    pw[i] = 1ll * pw[i - 1] * 173 % 1000000007, _pw[i] = _pw[i - 1] * 127;
  int l = (n - 1) / 2 + 1, r = n - l + 1;
  int lst = -1, ans = 0;
  while (r <= n) {
    int len = r - l + 1;
    if (len == 1)
      ans = -1;
    else {
      for (ans = lst + 2; ans > 0; ans -= 2)
        if (geth(l, l + ans - 1) == geth(r - ans + 1, r) &&
            _geth(l, l + ans - 1) == _geth(r - ans + 1, r))
          break;
    }
    st[++top] = ans, lst = ans, l--, r++;
  }
  for (int i = top; i; i--) printf("%d ", st[i]);
  puts("");
}

### Prompt

Please formulate a CPP solution 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;
int n;
char ch[2000200];
int has[2000200], pw[2000200];
unsigned long long _has[2000200], _pw[2000200];
int geth(int x, int y) {
  return (has[y] - 1ll * has[x - 1] * pw[y - x + 1] % 1000000007 + 1000000007) %
         1000000007;
}
unsigned long long _geth(int x, int y) {
  return _has[y] - _has[x - 1] * _pw[y - x + 1];
}
int st[2000200], top;
int main() {
  scanf("%d%s", &n, ch + 1);
  pw[0] = _pw[0] = 1;
  for (int i = 1; i <= n; i++)
    has[i] = (1ll * has[i - 1] * 173 % 1000000007 + ch[i]) % 1000000007,
    _has[i] = _has[i - 1] * 127 + ch[i],
    pw[i] = 1ll * pw[i - 1] * 173 % 1000000007, _pw[i] = _pw[i - 1] * 127;
  int l = (n - 1) / 2 + 1, r = n - l + 1;
  int lst = -1, ans = 0;
  while (r <= n) {
    int len = r - l + 1;
    if (len == 1)
      ans = -1;
    else {
      for (ans = lst + 2; ans > 0; ans -= 2)
        if (geth(l, l + ans - 1) == geth(r - ans + 1, r) &&
            _geth(l, l + ans - 1) == _geth(r - ans + 1, r))
          break;
    }
    st[++top] = ans, lst = ans, l--, r++;
  }
  for (int i = top; i; i--) printf("%d ", st[i]);
  puts("");
}

```