#include <bits/stdc++.h>
using namespace std;
long long n, f1[1000010], f2[1000010], n1[1000010], n2[1000010], s1, s2,
    h1[1000010], h2[1000010];
int an[1000010];
string st;
long long po(long long x, long long y, long long mo) {
  long long z = 1;
  while (y) {
    if (y % 2 == 1) z = (x * z) % mo;
    x = (x * x) % mo;
    y /= 2;
  }
  return z;
}
bool pan(int l1, int r1, int l2, int r2) {
  if (((h1[r1] - h1[l1 - 1] + 19260817) * n1[l1 - 1] % 19260817) !=
      ((h1[r2] - h1[l2 - 1] + 19260817) * n1[l2 - 1] % 19260817))
    return false;
  if (((h2[r1] - h2[l1 - 1] + 23456789) * n2[l1 - 1] % 23456789) !=
      ((h2[r2] - h2[l2 - 1] + 23456789) * n2[l2 - 1] % 23456789))
    return false;
  return true;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  cin >> st;
  f1[0] = 1, n1[0] = 1;
  n2[0] = 1;
  f2[0] = 1;
  s1 = po(29, 19260817 - 2, 19260817);
  s2 = po(31, 23456789 - 2, 23456789);
  for (int i = 1; i <= n; i++) {
    f1[i] = (f1[i - 1] * 29) % 19260817;
    f2[i] = (f2[i - 1] * 31) % 23456789;
    n1[i] = (n1[i - 1] * s1) % 19260817;
    n2[i] = (n2[i - 1] * s2) % 23456789;
  }
  for (int i = 1; i <= n; i++) {
    h1[i] = (h1[i - 1] + (st[i - 1] - '0') * f1[i - 1]) % 19260817;
    h2[i] = (h2[i - 1] + (st[i - 1] - '0') * f2[i - 1]) % 23456789;
  }
  for (int i = 1, j; i <= n / 2; i++) {
    j = n - i + 1;
    int l = 0, r = i, mid;
    while (l + 1 < r) {
      mid = (l + r) / 2;
      if (pan(i - mid + 1, i + mid - 1, j - mid + 1, j + mid - 1))
        l = mid;
      else
        r = mid;
    }
    if (pan(i - r + 1, i + r - 1, j - r + 1, j + r - 1)) l = r;
    if (l != 0) an[i - l + 1] = max(an[i - l + 1], l * 2 - 1);
  }
  for (int i = 1; i <= (n + 1) / 2; i++) {
    an[i] = max(an[i - 1] - 2, an[i]);
    if (an[i] == 0)
      cout << "-1" << ' ';
    else
      cout << an[i] << ' ';
  }
  return 0;
}

### Prompt

Develop a solution in cpp 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;
long long n, f1[1000010], f2[1000010], n1[1000010], n2[1000010], s1, s2,
    h1[1000010], h2[1000010];
int an[1000010];
string st;
long long po(long long x, long long y, long long mo) {
  long long z = 1;
  while (y) {
    if (y % 2 == 1) z = (x * z) % mo;
    x = (x * x) % mo;
    y /= 2;
  }
  return z;
}
bool pan(int l1, int r1, int l2, int r2) {
  if (((h1[r1] - h1[l1 - 1] + 19260817) * n1[l1 - 1] % 19260817) !=
      ((h1[r2] - h1[l2 - 1] + 19260817) * n1[l2 - 1] % 19260817))
    return false;
  if (((h2[r1] - h2[l1 - 1] + 23456789) * n2[l1 - 1] % 23456789) !=
      ((h2[r2] - h2[l2 - 1] + 23456789) * n2[l2 - 1] % 23456789))
    return false;
  return true;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  cin >> st;
  f1[0] = 1, n1[0] = 1;
  n2[0] = 1;
  f2[0] = 1;
  s1 = po(29, 19260817 - 2, 19260817);
  s2 = po(31, 23456789 - 2, 23456789);
  for (int i = 1; i <= n; i++) {
    f1[i] = (f1[i - 1] * 29) % 19260817;
    f2[i] = (f2[i - 1] * 31) % 23456789;
    n1[i] = (n1[i - 1] * s1) % 19260817;
    n2[i] = (n2[i - 1] * s2) % 23456789;
  }
  for (int i = 1; i <= n; i++) {
    h1[i] = (h1[i - 1] + (st[i - 1] - '0') * f1[i - 1]) % 19260817;
    h2[i] = (h2[i - 1] + (st[i - 1] - '0') * f2[i - 1]) % 23456789;
  }
  for (int i = 1, j; i <= n / 2; i++) {
    j = n - i + 1;
    int l = 0, r = i, mid;
    while (l + 1 < r) {
      mid = (l + r) / 2;
      if (pan(i - mid + 1, i + mid - 1, j - mid + 1, j + mid - 1))
        l = mid;
      else
        r = mid;
    }
    if (pan(i - r + 1, i + r - 1, j - r + 1, j + r - 1)) l = r;
    if (l != 0) an[i - l + 1] = max(an[i - l + 1], l * 2 - 1);
  }
  for (int i = 1; i <= (n + 1) / 2; i++) {
    an[i] = max(an[i - 1] - 2, an[i]);
    if (an[i] == 0)
      cout << "-1" << ' ';
    else
      cout << an[i] << ' ';
  }
  return 0;
}

```