<>;$s{$_}=1for<>; for(0..119){ @2=sort{.5<=>rand}qw(n b m g r); redo if $2{"@2"}++; push @20,[@2]; } while(1){ @1=sort{.5<=>rand}qw(i a a e u u); redo if $1{"@1"}++; for(@20){ @2=@$_; $s="$1[0]$2[0]$1[1]$2[1]$1[2]$2[2]$1[3]$2[3]$1[4]$2[4]$1[5]\n"; exit!print $s if !$s{$s}; } }