use integer;$"="|";$\="\n";$S='Just Another Happy Perl Hacker';$C=5;$L= length($S);%0=();sub o{$l=shift;return 1 if(exists($0{"@$l"}));$0{"@$l" }++;@n=0..$#$l;for$i(@n){for(@n){next if$i==$_;return 1 if index($$l[$i ],$$l[$_])!=-1}}0}@1=map{$_*length($S)/$C}0..$C-1;$.=0;while($.++<$L*100 ){@0=();for(0..$C-1){my$str=($_==$C-1)?substr($S,$1[$_]):substr($S,$1[$_ ],$1[$_+1]-$1[$_]);push@0,$str;}$.=0,print"@0" unless(o(\@0));$;=rand(@1 -1)+1;$1[$;]+=(rand(3)>1)?-1:1;$1[$;]=0 if$1[$;]<0;$1[$;]=$L-1 if$1[$;] >=$L;$1[$;]=$1[$;-1]+1 if$;>0&&$1[$;]<=$1[$;-1];$1[$;]=$1[$;+1]-1 if$;< $C-2&&$1[$;]>=$1[$;+1];}