#include <bits/stdc++.h>
using namespace std;
int n;
char S[2000005];
int Len[2000005], ans[2000005];
int v1[2000005], v2[2000005];
int s1[2000005], s2[2000005];
int Check(int pl, int pr, int L) {
  if ((1LL * (s1[pl + L - 1] - s1[pl - L] + 998244353) % 998244353 *
       v1[n - pl] % 998244353) !=
      (1LL * (s1[pr + L - 1] - s1[pr - L] + 998244353) % 998244353 *
       v1[n - pr] % 998244353))
    return 0;
  if ((1LL * (s2[pl + L - 1] - s2[pl - L] + 1000000007) % 1000000007 *
       v2[n - pl] % 1000000007) !=
      (1LL * (s2[pr + L - 1] - s2[pr - L] + 1000000007) % 1000000007 *
       v2[n - pr] % 1000000007))
    return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  scanf("%s", S + 1);
  v1[0] = v2[0] = 1;
  for (int i = 1; i <= n; i++)
    v1[i] = 131LL * v1[i - 1] % 998244353,
    v2[i] = 131LL * v2[i - 1] % 1000000007;
  for (int i = 1; i <= n; i++)
    s1[i] = (s1[i - 1] + 1LL * v1[i] * (S[i] - 'a' + 1)) % 998244353,
    s2[i] = (s2[i - 1] + 1LL * v2[i] * (S[i] - 'a' + 1)) % 1000000007;
  for (int i = 1; i <= n / 2; i++) {
    int L = 1, R = min(i, n - i + 1);
    while (L <= R) {
      int mid = (L + R) / 2;
      if (Check(i, n - i + 1, mid))
        Len[i] = mid, L = mid + 1;
      else
        R = mid - 1;
    }
    if (Len[i] >= 1)
      ans[i - Len[i] + 1] = max(ans[i - Len[i] + 1], 2 * Len[i] - 1);
  }
  for (int i = 1; i <= (n + 1) / 2; i++)
    if (ans[i]) {
      ans[i + 1] = max(ans[i + 1], ans[i] - 2);
      printf("%d ", ans[i]);
    } else
      printf("%d ", -1);
  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;
int n;
char S[2000005];
int Len[2000005], ans[2000005];
int v1[2000005], v2[2000005];
int s1[2000005], s2[2000005];
int Check(int pl, int pr, int L) {
  if ((1LL * (s1[pl + L - 1] - s1[pl - L] + 998244353) % 998244353 *
       v1[n - pl] % 998244353) !=
      (1LL * (s1[pr + L - 1] - s1[pr - L] + 998244353) % 998244353 *
       v1[n - pr] % 998244353))
    return 0;
  if ((1LL * (s2[pl + L - 1] - s2[pl - L] + 1000000007) % 1000000007 *
       v2[n - pl] % 1000000007) !=
      (1LL * (s2[pr + L - 1] - s2[pr - L] + 1000000007) % 1000000007 *
       v2[n - pr] % 1000000007))
    return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  scanf("%s", S + 1);
  v1[0] = v2[0] = 1;
  for (int i = 1; i <= n; i++)
    v1[i] = 131LL * v1[i - 1] % 998244353,
    v2[i] = 131LL * v2[i - 1] % 1000000007;
  for (int i = 1; i <= n; i++)
    s1[i] = (s1[i - 1] + 1LL * v1[i] * (S[i] - 'a' + 1)) % 998244353,
    s2[i] = (s2[i - 1] + 1LL * v2[i] * (S[i] - 'a' + 1)) % 1000000007;
  for (int i = 1; i <= n / 2; i++) {
    int L = 1, R = min(i, n - i + 1);
    while (L <= R) {
      int mid = (L + R) / 2;
      if (Check(i, n - i + 1, mid))
        Len[i] = mid, L = mid + 1;
      else
        R = mid - 1;
    }
    if (Len[i] >= 1)
      ans[i - Len[i] + 1] = max(ans[i - Len[i] + 1], 2 * Len[i] - 1);
  }
  for (int i = 1; i <= (n + 1) / 2; i++)
    if (ans[i]) {
      ans[i + 1] = max(ans[i + 1], ans[i] - 2);
      printf("%d ", ans[i]);
    } else
      printf("%d ", -1);
  return 0;
}

```