#include using namespace std; typedef long long ll; typedef long double ld; ll n; string s; //vectorv[26]; ll mod=1000000829; ll a[400005]; ll w[400005]; ll val=0; ll mult=101; ll fastpow(ll z, ll u) { if (u==0) return 1; if (u%2) { return (z*fastpow(z, u-1))%mod; } ll se=fastpow(z, u/2); se*=se; return se%mod; } ll getval(ll b, ll e) { //cerr<=n) return true; ll x=getvalb(m/2+1, n-1); ll y=getval(m/2-d,m/2-1); if (x%mod==y%mod) return true; return false; } else{ ll d=n-m/2; if (m/2>=n) return true; ll x=getvalb(m/2, n-1); ll y=getval(m/2-d,m/2-1); if (x%mod==y%mod) return true; return false; } return false; } int main() { ios_base::sync_with_stdio(false); cin>>n; cin>>s; for (int i=0; i=0; --i) { //v[s[i]-'a'].push_back(i); val*=mult; val%=mod; val+=s[i]-'a'+1; val%=mod; w[i]=val; } for (int i=0; i