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