import java.util.*; class Main { static final long MOD=1000000007; static final long P=1000000009; static long[]h,dp,p; static final long b=31; static long c(int x,int y){ long t=h[y]; t+=h[x]*(P-p[y-x])%P; return t%P; } public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s=scan.next(); int n=s.length(); int[]a=new int[n]; for(int i=0;i