#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a hash,p; RollingHash(){} RollingHash(const string &s,ull B=1000000007LL){ int n=s.size(); hash.assign(n+1,0); p.assign(n+1,1); for(int i=0;i>s; int n=s.size(); string t(s); reverse(t.begin(),t.end()); RollingHash rhs(s),rht(t); int ans=0; // odd for(int i=0;i>1; auto x=rhs.find(i+1,i+1+m); auto y=rht.find(n-i,n-i+m); if(x==y) l=m; else r=m; } if(l==min(i,n-i)){ if(l*2+1>1; auto x=rhs.find(i+2+p,i+2+m); auto y=rht.find(n-i+p,n-i+m); if(x==y) l=m; else r=m; } //cout<>1; auto x=rhs.find(i+1+p,i+1+m); auto y=rht.find(n-i+1+p,n-i+1+m); if(x==y) l=m; else r=m; } //cout<>1; auto x=rhs.find(i+2,i+2+m); auto y=rht.find(n-i,n-i+m); if(x==y) l=m; else r=m; } if(l==min(i,n-(i+1))){ if(l*2+2>1; auto x=rhs.find(i+3+p,i+3+m); auto y=rht.find(n-i+p,n-i+m); if(x==y) l=m; else r=m; } //cout<>1; auto x=rhs.find(i+2+p,i+2+m); auto y=rht.find(n-i+1+p,n-i+1+m); if(x==y) l=m; else r=m; } //cout<