Perhaps you want your arrays to actually be 26 long, rather than 25? There are, after all, 26 letters in the english alphabet.

By the way, I'm 100% + sure that this can be done using a few nested for-loops instead of generating all the letters of the alphabet into arrays. [Or, if you must use an array, why not use just one, repeatedly]. And I would recommend "for" instead of "while" in this case - it makes it much easier to read the code.

--
Mats