repeat l=io.read()T={}for i=1,#l do T[i]=(l..l):sub(i,#l+#T)end table.sort(T)S=" "x=0 for i=1,#l do x=T[i]