Problem

1 /19


Spell

Problem

The input to the program is the text of the spell, consisting of no more than 200 characters, ending with a dot (there are no other dots in the input data). It was encrypted by Harry Potter as follows. First, Harry determined the number of letters in the shortest word, denoting the resulting number through K (a word is a continuous sequence of English letters, words are separated from each other by any other characters, the length of the word does not exceed 20 characters). He then replaced each English letter in the spell with a letter in the English alphabet of the K letters after  (the alphabet is considered cyclic, that is, the letter A is preceded by the letter Z), leaving the other characters unchanged. Lowercase letters remained lowercase, while uppercase – uppercase. 
You need to write a program that will display the text of the decoded spell.
For example, if the ciphertext was Zb Ra Ca Dab Ra, then the decryption result should be Xz Py Ay Byz Py.