#include<iostream> #include<cstring> #include<cstdio> using namespace std; const int N=220010; using namespace std; char str[N]; char tmp[N]; int len[N]; int init(){ tmp[0]='$'; int i=0,nlen=1; while(str[i]!='