#include <bits/stdc++.h>
using namespace std;
ifstream in("test.in");
ofstream out("test.out");
const int NMAX = 1000009;
const int MOD1 = 666013;
const int MOD2 = 666019;
const int CNS1 = 27;
const int CNS2 = 29;
string str;
set<int> mst;
vector<int> upd[NMAX];
pair<int, int> hsh[NMAX], cns[NMAX];
inline pair<int, int> getHash(int l, int r) {
  pair<int, int> ans;
  ans.first = (-1LL * hsh[l - 1].first * cns[r - l + 1].first % MOD1 +
               hsh[r].first + MOD1) %
              MOD1;
  ans.second = (-1LL * hsh[l - 1].second * cns[r - l + 1].second % MOD2 +
                hsh[r].second + MOD2) %
               MOD2;
  return ans;
}
inline void debug(void) {
  pair<int, int> x = getHash(1, 9), y = getHash(7, 15);
  exit(0);
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n >> str;
  str = '#' + str;
  cns[0] = make_pair(1, 1);
  for (int i = 1; i <= n; ++i) {
    hsh[i].first = (1LL * hsh[i - 1].first * CNS1 + (str[i] - 'a')) % MOD1;
    hsh[i].second = (1LL * hsh[i - 1].second * CNS2 + (str[i] - 'a')) % MOD2;
    cns[i].first = 1LL * cns[i - 1].first * CNS1 % MOD1;
    cns[i].second = 1LL * cns[i - 1].second * CNS2 % MOD2;
  }
  for (int i = 1, j = n; i < j; ++i, --j) {
    int pos = 0;
    for (int le = 1, ri = i; le <= ri;) {
      int md = (le + ri) / 2;
      if (getHash(i - md + 1, i + md - 1) == getHash(j - md + 1, j + md - 1)) {
        le = md + 1;
        pos = md;
      } else {
        ri = md - 1;
      }
    }
    upd[i - pos + 1].push_back(i);
    upd[i + 1].push_back(-i);
  }
  for (int i = 1; i <= (n + 1) / 2; ++i) {
    for (int x : upd[i]) {
      if (x > 0) {
        mst.insert(x);
      } else {
        mst.erase(x);
      }
    }
    cout << (mst.size() ? ((*mst.rbegin() - i) * 2 + 1) : -1) << " ";
  }
  return 0;
}

### Prompt

Your task is to create 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;
ifstream in("test.in");
ofstream out("test.out");
const int NMAX = 1000009;
const int MOD1 = 666013;
const int MOD2 = 666019;
const int CNS1 = 27;
const int CNS2 = 29;
string str;
set<int> mst;
vector<int> upd[NMAX];
pair<int, int> hsh[NMAX], cns[NMAX];
inline pair<int, int> getHash(int l, int r) {
  pair<int, int> ans;
  ans.first = (-1LL * hsh[l - 1].first * cns[r - l + 1].first % MOD1 +
               hsh[r].first + MOD1) %
              MOD1;
  ans.second = (-1LL * hsh[l - 1].second * cns[r - l + 1].second % MOD2 +
                hsh[r].second + MOD2) %
               MOD2;
  return ans;
}
inline void debug(void) {
  pair<int, int> x = getHash(1, 9), y = getHash(7, 15);
  exit(0);
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n >> str;
  str = '#' + str;
  cns[0] = make_pair(1, 1);
  for (int i = 1; i <= n; ++i) {
    hsh[i].first = (1LL * hsh[i - 1].first * CNS1 + (str[i] - 'a')) % MOD1;
    hsh[i].second = (1LL * hsh[i - 1].second * CNS2 + (str[i] - 'a')) % MOD2;
    cns[i].first = 1LL * cns[i - 1].first * CNS1 % MOD1;
    cns[i].second = 1LL * cns[i - 1].second * CNS2 % MOD2;
  }
  for (int i = 1, j = n; i < j; ++i, --j) {
    int pos = 0;
    for (int le = 1, ri = i; le <= ri;) {
      int md = (le + ri) / 2;
      if (getHash(i - md + 1, i + md - 1) == getHash(j - md + 1, j + md - 1)) {
        le = md + 1;
        pos = md;
      } else {
        ri = md - 1;
      }
    }
    upd[i - pos + 1].push_back(i);
    upd[i + 1].push_back(-i);
  }
  for (int i = 1; i <= (n + 1) / 2; ++i) {
    for (int x : upd[i]) {
      if (x > 0) {
        mst.insert(x);
      } else {
        mst.erase(x);
      }
    }
    cout << (mst.size() ? ((*mst.rbegin() - i) * 2 + 1) : -1) << " ";
  }
  return 0;
}

```