#include <bits/stdc++.h>
char s[1200001];
int p1 = 1e9 + 7, p2 = 1e9 + 9, bs = 26;
int h1[1200001], h2[1200001], w1[1200001], w2[1200001];
int n, mid, l, r;
int ans[1200001];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  register int i, j, a1, b1, a2, b2;
  w1[0] = w2[0] = 1;
  for (i = 1; i <= n; ++i)
    w1[i] = 26LL * w1[i - 1] % p1, w2[i] = 26LL * w2[i - 1] % p2,
    h1[i] = (26LL * h1[i - 1] + s[i] - 'a') % p1,
    h2[i] = (26LL * h2[i - 1] + s[i] - 'a') % p2;
  mid = (n + 1) >> 1;
  if (n & 1) {
    ans[mid] = -1;
    l = mid, r = mid;
  } else {
    l = mid, r = mid + 1;
    if (s[mid] == s[mid + 1])
      ans[mid] = 1;
    else
      ans[mid] = -1;
  }
  for (i = mid - 1; i >= 1; --i) {
    l--, r++;
    for (j = ans[i + 1] + 2; j >= -1; j -= 2) {
      if (j == -1) {
        ans[i] = j;
        break;
      }
      a1 = (h1[l + j - 1] - (1LL * h1[l - 1] * w1[j] % p1) + p1) % p1;
      a2 = (h2[l + j - 1] - (1LL * h2[l - 1] * w2[j] % p2) + p2) % p2;
      b1 = (h1[r] - (1LL * h1[r - j] * w1[j] % p1) + p1) % p1;
      b2 = (h2[r] - (1LL * h2[r - j] * w2[j] % p2) + p2) % p2;
      if (a1 == b1 && a2 == b2) {
        ans[i] = j;
        break;
      }
    }
  }
  for (i = 1; i <= mid; ++i) printf("%d ", ans[i]);
}

### 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>
char s[1200001];
int p1 = 1e9 + 7, p2 = 1e9 + 9, bs = 26;
int h1[1200001], h2[1200001], w1[1200001], w2[1200001];
int n, mid, l, r;
int ans[1200001];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  register int i, j, a1, b1, a2, b2;
  w1[0] = w2[0] = 1;
  for (i = 1; i <= n; ++i)
    w1[i] = 26LL * w1[i - 1] % p1, w2[i] = 26LL * w2[i - 1] % p2,
    h1[i] = (26LL * h1[i - 1] + s[i] - 'a') % p1,
    h2[i] = (26LL * h2[i - 1] + s[i] - 'a') % p2;
  mid = (n + 1) >> 1;
  if (n & 1) {
    ans[mid] = -1;
    l = mid, r = mid;
  } else {
    l = mid, r = mid + 1;
    if (s[mid] == s[mid + 1])
      ans[mid] = 1;
    else
      ans[mid] = -1;
  }
  for (i = mid - 1; i >= 1; --i) {
    l--, r++;
    for (j = ans[i + 1] + 2; j >= -1; j -= 2) {
      if (j == -1) {
        ans[i] = j;
        break;
      }
      a1 = (h1[l + j - 1] - (1LL * h1[l - 1] * w1[j] % p1) + p1) % p1;
      a2 = (h2[l + j - 1] - (1LL * h2[l - 1] * w2[j] % p2) + p2) % p2;
      b1 = (h1[r] - (1LL * h1[r - j] * w1[j] % p1) + p1) % p1;
      b2 = (h2[r] - (1LL * h2[r - j] * w2[j] % p2) + p2) % p2;
      if (a1 == b1 && a2 == b2) {
        ans[i] = j;
        break;
      }
    }
  }
  for (i = 1; i <= mid; ++i) printf("%d ", ans[i]);
}

```