Words, permutations, and the nonsolvable length of a finite group