sub Z{ for(;;){@_=@l=map{splice@_,rand@_,1}@_;return@_ if join('',reverse@l)eq join'',map{map{chop}@l}@l} }