#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 29;
const int mod1 = 1e9 + 7, mod2 = 1e9 + 9;
const int base1 = 233, base2 = 197;
int hsh1[N], hsh2[N], b1[N], b2[N], ans[N];
int n;
char c[N];
bool check(int l1, int r1, int l2, int r2) {
  int x = r1 - l1 + 1;
  int res1 = (hsh1[r1] - 1LL * hsh1[l1 - 1] * b1[x] % mod1 + mod1) % mod1;
  int res2 = (hsh1[r2] - 1LL * hsh1[l2 - 1] * b1[x] % mod1 + mod1) % mod1;
  if (res1 != res2) return false;
  res1 = (hsh2[r1] - 1LL * hsh2[l1 - 1] * b2[x] % mod2 + mod2) % mod2;
  res2 = (hsh2[r2] - 1LL * hsh2[l2 - 1] * b2[x] % mod2 + mod2) % mod2;
  if (res2 != res1) return false;
  return true;
}
int main() {
  scanf("%d%s", &n, c + 1);
  b1[0] = b2[0] = 1;
  for (int i = 1; i <= n; ++i) {
    hsh1[i] = (1LL * hsh1[i - 1] * base1 + c[i]) % mod1;
    b1[i] = 1LL * b1[i - 1] * base1 % mod1;
    hsh2[i] = (1LL * hsh2[i - 1] * base2 + c[i]) % mod2;
    b2[i] = 1LL * b2[i - 1] * base2 % mod2;
  }
  memset(ans, -1, sizeof(ans));
  for (int i = 1; i <= n / 2; ++i) {
    int l = 1, r = i + 1;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (check(i - mid + 1, i + mid - 1, n - i + 2 - mid, n - i + mid))
        l = mid + 1;
      else
        r = mid;
    }
    l--;
    ans[i - l + 1] = max(ans[i - l + 1], l * 2 - 1);
  }
  for (int i = 1; i <= n / 2; ++i) {
    ans[i] = max(ans[i], ans[i - 1] - 2);
    printf("%d ", ans[i]);
  }
  if (n & 1) printf("-1");
  return 0;
}

### Prompt

Please provide a cpp coded solution 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 N = 2e6 + 29;
const int mod1 = 1e9 + 7, mod2 = 1e9 + 9;
const int base1 = 233, base2 = 197;
int hsh1[N], hsh2[N], b1[N], b2[N], ans[N];
int n;
char c[N];
bool check(int l1, int r1, int l2, int r2) {
  int x = r1 - l1 + 1;
  int res1 = (hsh1[r1] - 1LL * hsh1[l1 - 1] * b1[x] % mod1 + mod1) % mod1;
  int res2 = (hsh1[r2] - 1LL * hsh1[l2 - 1] * b1[x] % mod1 + mod1) % mod1;
  if (res1 != res2) return false;
  res1 = (hsh2[r1] - 1LL * hsh2[l1 - 1] * b2[x] % mod2 + mod2) % mod2;
  res2 = (hsh2[r2] - 1LL * hsh2[l2 - 1] * b2[x] % mod2 + mod2) % mod2;
  if (res2 != res1) return false;
  return true;
}
int main() {
  scanf("%d%s", &n, c + 1);
  b1[0] = b2[0] = 1;
  for (int i = 1; i <= n; ++i) {
    hsh1[i] = (1LL * hsh1[i - 1] * base1 + c[i]) % mod1;
    b1[i] = 1LL * b1[i - 1] * base1 % mod1;
    hsh2[i] = (1LL * hsh2[i - 1] * base2 + c[i]) % mod2;
    b2[i] = 1LL * b2[i - 1] * base2 % mod2;
  }
  memset(ans, -1, sizeof(ans));
  for (int i = 1; i <= n / 2; ++i) {
    int l = 1, r = i + 1;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (check(i - mid + 1, i + mid - 1, n - i + 2 - mid, n - i + mid))
        l = mid + 1;
      else
        r = mid;
    }
    l--;
    ans[i - l + 1] = max(ans[i - l + 1], l * 2 - 1);
  }
  for (int i = 1; i <= n / 2; ++i) {
    ans[i] = max(ans[i], ans[i - 1] - 2);
    printf("%d ", ans[i]);
  }
  if (n & 1) printf("-1");
  return 0;
}

```