#include <bits/stdc++.h>
using namespace std;
int n;
string s;
pair<int, unsigned long long> h[1000005];
pair<int, unsigned long long> p[1000005];
const int BASE = 1337;
const int MOD = 1000000007;
int w[500005], z[500005];
pair<int, unsigned long long> hv(int l, int r) {
  int u = h[r].first - h[l].first * 1ll * p[r - l].first % MOD;
  if (u < 0) u += MOD;
  return {u, h[r].second - h[l].second * p[r - l].second};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  p[0].first = 1;
  p[0].second = 1;
  for (int i = 1; i < 1000005; i++) {
    p[i].first = p[i - 1].first * 1ll * BASE % MOD;
    p[i].second = p[i - 1].second * BASE;
  }
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    h[i + 1].first = (h[i].first * 1ll * BASE + s[i]) % MOD;
    h[i + 1].second = h[i].second * BASE + s[i];
  }
  fill(z, z + n, -1);
  for (int i = 0, j = n - 1; i <= j; i++, j--) {
    int lo = 0, hi = i, o = -1;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      if (hv(i - mid, i + mid + 1) == hv(j - mid, j + mid + 1)) {
        o = mid;
        lo = mid + 1;
      } else {
        hi = mid - 1;
      }
    }
    w[i] = o;
    if (i != j) z[i - w[i]] = max(z[i - w[i]], w[i]);
  }
  for (int i = 0; i < n / 2; i++) {
    if (i) z[i] = max(z[i], z[i - 1] - 1);
    cout << 2 * z[i] + 1 << ' ';
  }
  if (n % 2)
    cout << "-1\n";
  else
    cout << "\n";
}

### 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;
string s;
pair<int, unsigned long long> h[1000005];
pair<int, unsigned long long> p[1000005];
const int BASE = 1337;
const int MOD = 1000000007;
int w[500005], z[500005];
pair<int, unsigned long long> hv(int l, int r) {
  int u = h[r].first - h[l].first * 1ll * p[r - l].first % MOD;
  if (u < 0) u += MOD;
  return {u, h[r].second - h[l].second * p[r - l].second};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  p[0].first = 1;
  p[0].second = 1;
  for (int i = 1; i < 1000005; i++) {
    p[i].first = p[i - 1].first * 1ll * BASE % MOD;
    p[i].second = p[i - 1].second * BASE;
  }
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    h[i + 1].first = (h[i].first * 1ll * BASE + s[i]) % MOD;
    h[i + 1].second = h[i].second * BASE + s[i];
  }
  fill(z, z + n, -1);
  for (int i = 0, j = n - 1; i <= j; i++, j--) {
    int lo = 0, hi = i, o = -1;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      if (hv(i - mid, i + mid + 1) == hv(j - mid, j + mid + 1)) {
        o = mid;
        lo = mid + 1;
      } else {
        hi = mid - 1;
      }
    }
    w[i] = o;
    if (i != j) z[i - w[i]] = max(z[i - w[i]], w[i]);
  }
  for (int i = 0; i < n / 2; i++) {
    if (i) z[i] = max(z[i], z[i - 1] - 1);
    cout << 2 * z[i] + 1 << ' ';
  }
  if (n % 2)
    cout << "-1\n";
  else
    cout << "\n";
}

```