Works out anagrams of input