#include <bits/stdc++.h>
using namespace std;
int N;
char S[1000005];
int DP[1000005];
const int Base = 73;
const int MOD = 1000000007;
int Hash[1000005], Pw[1000005];
void Read() {
  cin >> N;
  cin.get();
  cin.getline(S + 1, 1000005);
}
void buildPower() {
  Pw[0] = 1;
  for (int i = 1; i <= N; i++) Pw[i] = (1LL * Pw[i - 1] * Base) % MOD;
}
inline void Add(int& x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
void buildHashes() {
  for (int i = N; i >= 1; i--) {
    Hash[i] = Hash[i + 1];
    Add(Hash[i], (1LL * (S[i] - 'a' + 1) * Pw[N - i]) % MOD);
  }
}
bool checkEquality(int left1, int right1, int left2, int right2) {
  int diff1 = Hash[left1] - Hash[right1 + 1];
  if (diff1 < 0) diff1 += MOD;
  diff1 = (1LL * diff1 * Pw[left1 - 1]) % MOD;
  int diff2 = Hash[left2] - Hash[right2 + 1];
  if (diff2 < 0) diff2 += MOD;
  diff2 = (1LL * diff2 * Pw[left2 - 1]) % MOD;
  return diff1 == diff2;
}
void binSearch(int center) {
  int left = 0, right = center - 1, sol = -1, sim = N - center + 1;
  while (left <= right) {
    int mid = (left + right) / 2;
    if (checkEquality(center - mid, center + mid, sim - mid, sim + mid)) {
      sol = mid;
      left = mid + 1;
    } else
      right = mid - 1;
  }
  if (sol != -1) DP[center - sol] = 2 * sol + 1;
}
void Solve() {
  for (int i = 1; i <= N / 2; i++) binSearch(i);
  for (int i = 1; i <= (N + 1) / 2; i++) {
    DP[i] = max(DP[i], DP[i - 1] - 2);
    if (DP[i] == 0) DP[i] = -1;
    cout << DP[i] << " ";
  }
  cout << "\n";
}
int main() {
  Read();
  buildPower();
  buildHashes();
  Solve();
  return 0;
}

### Prompt

Please provide a CPP coded solution to the problem described below:

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;
char S[1000005];
int DP[1000005];
const int Base = 73;
const int MOD = 1000000007;
int Hash[1000005], Pw[1000005];
void Read() {
  cin >> N;
  cin.get();
  cin.getline(S + 1, 1000005);
}
void buildPower() {
  Pw[0] = 1;
  for (int i = 1; i <= N; i++) Pw[i] = (1LL * Pw[i - 1] * Base) % MOD;
}
inline void Add(int& x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
void buildHashes() {
  for (int i = N; i >= 1; i--) {
    Hash[i] = Hash[i + 1];
    Add(Hash[i], (1LL * (S[i] - 'a' + 1) * Pw[N - i]) % MOD);
  }
}
bool checkEquality(int left1, int right1, int left2, int right2) {
  int diff1 = Hash[left1] - Hash[right1 + 1];
  if (diff1 < 0) diff1 += MOD;
  diff1 = (1LL * diff1 * Pw[left1 - 1]) % MOD;
  int diff2 = Hash[left2] - Hash[right2 + 1];
  if (diff2 < 0) diff2 += MOD;
  diff2 = (1LL * diff2 * Pw[left2 - 1]) % MOD;
  return diff1 == diff2;
}
void binSearch(int center) {
  int left = 0, right = center - 1, sol = -1, sim = N - center + 1;
  while (left <= right) {
    int mid = (left + right) / 2;
    if (checkEquality(center - mid, center + mid, sim - mid, sim + mid)) {
      sol = mid;
      left = mid + 1;
    } else
      right = mid - 1;
  }
  if (sol != -1) DP[center - sol] = 2 * sol + 1;
}
void Solve() {
  for (int i = 1; i <= N / 2; i++) binSearch(i);
  for (int i = 1; i <= (N + 1) / 2; i++) {
    DP[i] = max(DP[i], DP[i - 1] - 2);
    if (DP[i] == 0) DP[i] = -1;
    cout << DP[i] << " ";
  }
  cout << "\n";
}
int main() {
  Read();
  buildPower();
  buildHashes();
  Solve();
  return 0;
}

```