#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <class T1, class T2>
void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
using Pi = pair<long long, long long>;
using Tapris = tuple<long long, long long, long long>;
using vint = vector<long long>;
const long long inf = 1LL << 55;
const long long mod = 1e9 + 7;
struct RollHash {
  using ull = unsigned long long;
  using hash_t = pair<ull, ull>;
  ull base, mod[2];
  vector<ull> ha[2], pw[2];
  RollHash(const string &s) {
    base = 9973ull;
    mod[0] = 999999937ull;
    mod[1] = 1000000007ull;
    long long sz = s.size();
    for (long long i = 0; i < 2; ++i) {
      ha[i].resize(sz + 1, 0);
      pw[i].resize(sz + 1, 0);
      pw[i][0] = 1;
      for (long long j = 0; j < sz; ++j) {
        pw[i][j + 1] = pw[i][j] * base % mod[i];
        ha[i][j + 1] = (ha[i][j] * base + s[j]) % mod[i];
      }
    }
  }
  hash_t get(long long l, long long r) {
    hash_t res;
    res.first = (ha[0][r] - ha[0][l] * pw[0][r - l] % mod[0] + mod[0]) % mod[0];
    res.second =
        (ha[1][r] - ha[1][l] * pw[1][r - l] % mod[1] + mod[1]) % mod[1];
    return res;
  }
  hash_t concat(hash_t hash1, hash_t hash2, long long hash2_len) {
    hash_t res;
    res.first = (hash1.first * pw[0][hash2_len] + hash2.first) % mod[0];
    res.second = (hash1.second * pw[1][hash2_len] + hash2.second) % mod[1];
    return res;
  }
};
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);
  long long n;
  string s;
  cin >> n >> s;
  RollHash rh(s);
  vint valid;
  for (long long i = (long long)(0); i < (long long)(n / 2); i++) {
    if (s[i] == s[n - 1 - i]) valid.push_back(i);
  }
  vint ans((n + 1) / 2, -1);
  vint mli((n + 1) / 2, -1);
  for (long long i : valid) {
    long long lb = 0, ub = i + 1;
    long long j = n - i - 1;
    while (lb + 1 < ub) {
      long long mb = (lb + ub) / 2;
      if (rh.get(i - mb, i + mb + 1) == rh.get(j - mb, j + mb + 1))
        lb = mb;
      else
        ub = mb;
    }
    mli[i] = lb;
  }
  for (long long i = (long long)(0); i < (long long)(n / 2); i++) {
    if (mli[i] != -1) chmax(ans[i - mli[i]], 2 * mli[i] + 1);
  }
  for (long long i = (long long)(0); i < (long long)((n + 1) / 2); i++) {
    if (i) chmax(ans[i], ans[i - 1] - 2);
    cout << ans[i] << " \n"[i == (n + 1) / 2 - 1];
  }
  return 0;
}

### Prompt

In Cpp, your task is to solve 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;
template <class T1, class T2>
void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <class T1, class T2>
void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
using Pi = pair<long long, long long>;
using Tapris = tuple<long long, long long, long long>;
using vint = vector<long long>;
const long long inf = 1LL << 55;
const long long mod = 1e9 + 7;
struct RollHash {
  using ull = unsigned long long;
  using hash_t = pair<ull, ull>;
  ull base, mod[2];
  vector<ull> ha[2], pw[2];
  RollHash(const string &s) {
    base = 9973ull;
    mod[0] = 999999937ull;
    mod[1] = 1000000007ull;
    long long sz = s.size();
    for (long long i = 0; i < 2; ++i) {
      ha[i].resize(sz + 1, 0);
      pw[i].resize(sz + 1, 0);
      pw[i][0] = 1;
      for (long long j = 0; j < sz; ++j) {
        pw[i][j + 1] = pw[i][j] * base % mod[i];
        ha[i][j + 1] = (ha[i][j] * base + s[j]) % mod[i];
      }
    }
  }
  hash_t get(long long l, long long r) {
    hash_t res;
    res.first = (ha[0][r] - ha[0][l] * pw[0][r - l] % mod[0] + mod[0]) % mod[0];
    res.second =
        (ha[1][r] - ha[1][l] * pw[1][r - l] % mod[1] + mod[1]) % mod[1];
    return res;
  }
  hash_t concat(hash_t hash1, hash_t hash2, long long hash2_len) {
    hash_t res;
    res.first = (hash1.first * pw[0][hash2_len] + hash2.first) % mod[0];
    res.second = (hash1.second * pw[1][hash2_len] + hash2.second) % mod[1];
    return res;
  }
};
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);
  long long n;
  string s;
  cin >> n >> s;
  RollHash rh(s);
  vint valid;
  for (long long i = (long long)(0); i < (long long)(n / 2); i++) {
    if (s[i] == s[n - 1 - i]) valid.push_back(i);
  }
  vint ans((n + 1) / 2, -1);
  vint mli((n + 1) / 2, -1);
  for (long long i : valid) {
    long long lb = 0, ub = i + 1;
    long long j = n - i - 1;
    while (lb + 1 < ub) {
      long long mb = (lb + ub) / 2;
      if (rh.get(i - mb, i + mb + 1) == rh.get(j - mb, j + mb + 1))
        lb = mb;
      else
        ub = mb;
    }
    mli[i] = lb;
  }
  for (long long i = (long long)(0); i < (long long)(n / 2); i++) {
    if (mli[i] != -1) chmax(ans[i - mli[i]], 2 * mli[i] + 1);
  }
  for (long long i = (long long)(0); i < (long long)((n + 1) / 2); i++) {
    if (i) chmax(ans[i], ans[i - 1] - 2);
    cout << ans[i] << " \n"[i == (n + 1) / 2 - 1];
  }
  return 0;
}

```