partition into anagrams and palindromic permutation