#include <bits/stdc++.h>
using namespace std;
int n, lim, Max[1000000 + 5], Ans[1000000 + 5], Pow[2][1000000 + 5],
    Hash[2][1000000 + 5];
char s[1000000 + 5];
class HASH {
 public:
  HASH() {}
  HASH(char *p, int _sz, int _K, int _Mod, int *_pow, int *_hash)
      : sz(_sz), K(_K), Mod(_Mod), pow(_pow), hash(_hash) {
    pow[0] = 1, hash[0] = 0;
    for (int i = 1; i <= sz; i++) {
      pow[i] = 1LL * pow[i - 1] * K % Mod;
      hash[i] = (1LL * hash[i - 1] * K + p[i] - 'a' + 5) % Mod;
    }
  }
  int GetValue(int l, int r) {
    int t_r = hash[r], t_l = 1LL * hash[l - 1] * pow[r - l + 1] % Mod;
    return (t_r - t_l + Mod) % Mod;
  }

 private:
  int sz, K, Mod;
  int *pow, *hash;
} Hash1, Hash2;
int Calc(int c_1, int c_2) {
  int l = 0, r = min(min(c_1, n - c_1 + 1), min(c_2, n - c_2 + 1));
  while (l < r) {
    int mid = l + r + 1 >> 1;
    int l_1 = c_1 - mid + 1, r_1 = c_1 + mid - 1;
    int l_2 = c_2 - mid + 1, r_2 = c_2 + mid - 1;
    if (Hash1.GetValue(l_1, r_1) == Hash1.GetValue(l_2, r_2) &&
        Hash2.GetValue(l_1, r_1) == Hash2.GetValue(l_2, r_2))
      l = mid;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  scanf("%d", &n);
  lim = n + 1 >> 1;
  scanf("%s", s + 1);
  Hash1 = HASH(s, n, 37, 1000000007, Pow[0], Hash[0]);
  Hash2 = HASH(s, n, 41, 998244353, Pow[1], Hash[1]);
  for (int i = 1; i < lim + (n + 1 & 1); i++)
    Max[i - Calc(i, n - i + 1) + 1] = i;
  for (int i = 1; i <= lim; i++) {
    Max[i] = max(Max[i - 1], Max[i]);
    Ans[i] = Max[i] >= i ? (Max[i] - i) * 2 + 1 : -1;
  }
  for (int i = 1; i <= lim; i++) printf("%d%c", Ans[i], i == lim ? '\n' : ' ');
  return 0;
}

### Prompt

Your challenge is to write 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, lim, Max[1000000 + 5], Ans[1000000 + 5], Pow[2][1000000 + 5],
    Hash[2][1000000 + 5];
char s[1000000 + 5];
class HASH {
 public:
  HASH() {}
  HASH(char *p, int _sz, int _K, int _Mod, int *_pow, int *_hash)
      : sz(_sz), K(_K), Mod(_Mod), pow(_pow), hash(_hash) {
    pow[0] = 1, hash[0] = 0;
    for (int i = 1; i <= sz; i++) {
      pow[i] = 1LL * pow[i - 1] * K % Mod;
      hash[i] = (1LL * hash[i - 1] * K + p[i] - 'a' + 5) % Mod;
    }
  }
  int GetValue(int l, int r) {
    int t_r = hash[r], t_l = 1LL * hash[l - 1] * pow[r - l + 1] % Mod;
    return (t_r - t_l + Mod) % Mod;
  }

 private:
  int sz, K, Mod;
  int *pow, *hash;
} Hash1, Hash2;
int Calc(int c_1, int c_2) {
  int l = 0, r = min(min(c_1, n - c_1 + 1), min(c_2, n - c_2 + 1));
  while (l < r) {
    int mid = l + r + 1 >> 1;
    int l_1 = c_1 - mid + 1, r_1 = c_1 + mid - 1;
    int l_2 = c_2 - mid + 1, r_2 = c_2 + mid - 1;
    if (Hash1.GetValue(l_1, r_1) == Hash1.GetValue(l_2, r_2) &&
        Hash2.GetValue(l_1, r_1) == Hash2.GetValue(l_2, r_2))
      l = mid;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  scanf("%d", &n);
  lim = n + 1 >> 1;
  scanf("%s", s + 1);
  Hash1 = HASH(s, n, 37, 1000000007, Pow[0], Hash[0]);
  Hash2 = HASH(s, n, 41, 998244353, Pow[1], Hash[1]);
  for (int i = 1; i < lim + (n + 1 & 1); i++)
    Max[i - Calc(i, n - i + 1) + 1] = i;
  for (int i = 1; i <= lim; i++) {
    Max[i] = max(Max[i - 1], Max[i]);
    Ans[i] = Max[i] >= i ? (Max[i] - i) * 2 + 1 : -1;
  }
  for (int i = 1; i <= lim; i++) printf("%d%c", Ans[i], i == lim ? '\n' : ' ');
  return 0;
}

```