#include <bits/stdc++.h>
using namespace std;
const long long BF = 1999;
const long long BS = 5575777;
const long long modF = 1000000007;
const long long modS = 1000000009;
pair<long long, long long> push(pair<long long, long long> h, char ch) {
  return pair<long long, long long>((h.first * BF + ch) % modF,
                                    (h.second * BS + ch) % modS);
}
pair<long long, long long> add(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>((a.first + b.first) % modF,
                                    (a.second + b.second) % modS);
}
pair<long long, long long> sub(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>((a.first - b.first + modF) % modF,
                                    (a.second - b.second + modS) % modS);
}
pair<long long, long long> mul(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>((a.first * b.first) % modF,
                                    (a.second * b.second) % modS);
}
pair<long long, long long> Make(long long x) {
  return pair<long long, long long>(x % modF, x % modS);
}
int n;
char s[1500000];
pair<long long, long long> t[1500000];
pair<long long, long long> po[1500000];
pair<long long, long long> to[1500000];
pair<long long, long long> getHash(int l, int r) {
  int len = r - l;
  return sub(t[r], mul(t[l], po[len]));
}
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 1; i <= n; i++) {
    t[i] = push(t[i - 1], s[i - 1]);
  }
  po[0] = Make(1);
  for (int i = 1; i <= n + 1; i++) {
    po[i] = push(po[i - 1], 0);
    to[i] = add(po[i - 1], to[i - 1]);
  }
  map<int, int> ans;
  for (int i = 0; i < n / 2; i++) {
    int j = n - 1 - i;
    if (s[i] != s[j]) continue;
    int left = 0, right = i + 1;
    while (left + 1 < right) {
      int mid = (left + right) / 2;
      if (getHash(i - mid, i + 1 + mid) == getHash(j - mid, j + 1 + mid)) {
        left = mid;
      } else {
        right = mid;
      }
    }
    ans[i - left] = max(ans[i - left], i);
  }
  int tmp = -1;
  for (int i = 0; i < n / 2 + n % 2; i++) {
    if (ans.count(i)) {
      tmp = max(tmp, ans[i]);
    }
    if (tmp < i) {
      cout << -1 << endl;
      continue;
    }
    cout << (tmp - i) * 2 + 1 << endl;
  }
  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;
const long long BF = 1999;
const long long BS = 5575777;
const long long modF = 1000000007;
const long long modS = 1000000009;
pair<long long, long long> push(pair<long long, long long> h, char ch) {
  return pair<long long, long long>((h.first * BF + ch) % modF,
                                    (h.second * BS + ch) % modS);
}
pair<long long, long long> add(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>((a.first + b.first) % modF,
                                    (a.second + b.second) % modS);
}
pair<long long, long long> sub(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>((a.first - b.first + modF) % modF,
                                    (a.second - b.second + modS) % modS);
}
pair<long long, long long> mul(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>((a.first * b.first) % modF,
                                    (a.second * b.second) % modS);
}
pair<long long, long long> Make(long long x) {
  return pair<long long, long long>(x % modF, x % modS);
}
int n;
char s[1500000];
pair<long long, long long> t[1500000];
pair<long long, long long> po[1500000];
pair<long long, long long> to[1500000];
pair<long long, long long> getHash(int l, int r) {
  int len = r - l;
  return sub(t[r], mul(t[l], po[len]));
}
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 1; i <= n; i++) {
    t[i] = push(t[i - 1], s[i - 1]);
  }
  po[0] = Make(1);
  for (int i = 1; i <= n + 1; i++) {
    po[i] = push(po[i - 1], 0);
    to[i] = add(po[i - 1], to[i - 1]);
  }
  map<int, int> ans;
  for (int i = 0; i < n / 2; i++) {
    int j = n - 1 - i;
    if (s[i] != s[j]) continue;
    int left = 0, right = i + 1;
    while (left + 1 < right) {
      int mid = (left + right) / 2;
      if (getHash(i - mid, i + 1 + mid) == getHash(j - mid, j + 1 + mid)) {
        left = mid;
      } else {
        right = mid;
      }
    }
    ans[i - left] = max(ans[i - left], i);
  }
  int tmp = -1;
  for (int i = 0; i < n / 2 + n % 2; i++) {
    if (ans.count(i)) {
      tmp = max(tmp, ans[i]);
    }
    if (tmp < i) {
      cout << -1 << endl;
      continue;
    }
    cout << (tmp - i) * 2 + 1 << endl;
  }
  return 0;
}

```