import java.util.*; class Main { static final long MOD=1000000007; static final long P=1000000009; static final long[]Q={MOD,P}; static long[]dp; static long[][]h,p; static final long b=31; static long c(int x,int y,int j){ long t=h[j][y]; t+=h[j][x]*(Q[j]-p[j][y-x])%Q[j]; return t%Q[j]; } 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