#include<iostream> #include<cstdlib> #include<cstdio> usingnamespacestd; inlineintread() { int f = 1, x = 0; char ch;
do{ ch = getchar(); if (ch == '-') f = -1; }while(ch < '0' || ch > '9'); do{ x = x * 10 + ch - '0'; ch = getchar(); }while(ch >= '0' && ch <= '9'); return f * x; } constint N = 2.2e7;
string a; char s[N + 2]; int n; int d[N + 2]; int ans;
inlinevoidinit() { s[0] = '('; s[1] = '#'; for (int i = 0; i < n; i++) { s[(i + 1) << 1] = a[i]; s[((i + 1) << 1) + 1] = '#'; } n = (n + 1) << 1; return; } inlinevoidmanacher() { int l = 0, r = -1;
for (int i = 1; i < n; i++) { if (i < r) d[i] = min(d[l + r - i], r - i); while (s[i - d[i] - 1] == s[i + d[i] + 1]) d[i]++; if (i + d[i] > r) { r = i + d[i]; l = i - d[i]; } ans = max(ans, d[i]); } return; } intmain() { cin >> a; n = a.size();