#include <bits/stdc++.h>
using namespace std;
const unsigned long long base = 20123;
const unsigned long long mod = 1e9 + 9;
const int N = 1e6 + 10;
char s[N];
int ans[N];
int n;
unsigned long long c[N];
unsigned long long bin[N], Hash[N], _bin[N], _hash[N];
unsigned long long seed = 99999997;
unsigned long long rnd() { return seed = seed * 13 + 17; }
void init() {
  bin[0] = 1;
  _bin[0] = 1;
  for (int i(1); i <= (n); ++i)
    bin[i] = bin[i - 1] * base, _bin[i] = _bin[i - 1] * base % mod;
  for (int i(1); i <= (n); ++i)
    Hash[i] = Hash[i - 1] * base + c[(int)s[i] - 'a'];
  for (int i(1); i <= (n); ++i)
    _hash[i] = (_hash[i - 1] * base % mod + c[(int)s[i] - 'a']) % mod;
}
inline unsigned long long gethash(int l, int r) {
  return Hash[r] - Hash[l - 1] * bin[r - l + 1];
}
inline unsigned long long _gethash(int l, int r) {
  return ((_hash[r] - _hash[l - 1] * _bin[r - l + 1] % mod) + mod) % mod;
}
int main() {
  for (int i(0); i <= (30); ++i) c[i] = rnd() * rnd() * rnd();
  scanf("%d", &n);
  scanf("%s", s + 1);
  init();
  memset(ans, -1, sizeof ans);
  for (int i(1); i <= (n >> 1); ++i) {
    int l = 0, r = i;
    int pos = n - i + 1;
    if (s[i] != s[pos]) continue;
    while (l + 1 < r) {
      int mid = (l + r) >> 1;
      if (gethash(i - mid + 1, i + mid - 1) ==
              gethash(pos - mid + 1, pos + mid - 1) &&
          _gethash(i - mid + 1, i + mid - 1) ==
              _gethash(pos - mid + 1, pos + mid - 1))
        l = mid;
      else
        r = mid - 1;
    }
    int t;
    if (gethash(i - r + 1, i + r - 1) == gethash(pos - r + 1, pos + r - 1) &&
        _gethash(i - r + 1, i + r - 1) == _gethash(pos - r + 1, pos + r - 1))
      t = r;
    else
      t = l;
    ans[i - t + 1] = max(ans[i - t + 1], 2 * t - 1);
  }
  for (int i(1); i <= ((n + 1) >> 1); ++i) ans[i] = max(ans[i], ans[i - 1] - 2);
  for (int i(1); i <= ((n + 1) >> 1); ++i) printf("%d\n", ans[i]);
  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;
const unsigned long long base = 20123;
const unsigned long long mod = 1e9 + 9;
const int N = 1e6 + 10;
char s[N];
int ans[N];
int n;
unsigned long long c[N];
unsigned long long bin[N], Hash[N], _bin[N], _hash[N];
unsigned long long seed = 99999997;
unsigned long long rnd() { return seed = seed * 13 + 17; }
void init() {
  bin[0] = 1;
  _bin[0] = 1;
  for (int i(1); i <= (n); ++i)
    bin[i] = bin[i - 1] * base, _bin[i] = _bin[i - 1] * base % mod;
  for (int i(1); i <= (n); ++i)
    Hash[i] = Hash[i - 1] * base + c[(int)s[i] - 'a'];
  for (int i(1); i <= (n); ++i)
    _hash[i] = (_hash[i - 1] * base % mod + c[(int)s[i] - 'a']) % mod;
}
inline unsigned long long gethash(int l, int r) {
  return Hash[r] - Hash[l - 1] * bin[r - l + 1];
}
inline unsigned long long _gethash(int l, int r) {
  return ((_hash[r] - _hash[l - 1] * _bin[r - l + 1] % mod) + mod) % mod;
}
int main() {
  for (int i(0); i <= (30); ++i) c[i] = rnd() * rnd() * rnd();
  scanf("%d", &n);
  scanf("%s", s + 1);
  init();
  memset(ans, -1, sizeof ans);
  for (int i(1); i <= (n >> 1); ++i) {
    int l = 0, r = i;
    int pos = n - i + 1;
    if (s[i] != s[pos]) continue;
    while (l + 1 < r) {
      int mid = (l + r) >> 1;
      if (gethash(i - mid + 1, i + mid - 1) ==
              gethash(pos - mid + 1, pos + mid - 1) &&
          _gethash(i - mid + 1, i + mid - 1) ==
              _gethash(pos - mid + 1, pos + mid - 1))
        l = mid;
      else
        r = mid - 1;
    }
    int t;
    if (gethash(i - r + 1, i + r - 1) == gethash(pos - r + 1, pos + r - 1) &&
        _gethash(i - r + 1, i + r - 1) == _gethash(pos - r + 1, pos + r - 1))
      t = r;
    else
      t = l;
    ans[i - t + 1] = max(ans[i - t + 1], 2 * t - 1);
  }
  for (int i(1); i <= ((n + 1) >> 1); ++i) ans[i] = max(ans[i], ans[i - 1] - 2);
  for (int i(1); i <= ((n + 1) >> 1); ++i) printf("%d\n", ans[i]);
  return 0;
}

```