Sort alphabets before comparison