isomorphic words, randomized select and second min