perl -E'sub w{join"",sort pop=~/./g}$w=w pop;($w~~w$_)&&print for<>' ./dict.txt acert