Lady of the Lake

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

King Arthur Pendragon is said to have been a great king of Britain, wielding the legendary sword Excalibur. After his final battle and the defeat of his nemesis, Mordred, King Arthur must return his sword to the one who gave it to him, the Lady of the Lake. The Lady of the Lake speaks an ancient language that only King Arthur understands. To the human ear, the language of the Lady of the Lake takes every letter in her speech, and shifts forward every letter by the absolute value of the difference between the current letter and the original previous letter. Should this shift take the letter past z, it is looped back to a and continues. For instance, if the Lady of the Lake means to speak the word cat, the first letter is kept the same but the second letter takes the difference between a and c in the alphabet, which is 2 and shifts by that amount. The third letter, t, shifts by the difference between a and t for a total of 19. The word, spoken in the language of the Lady of the Lake is ccm. Given the original phrase, translate it to the language of the Lady of the Lake.

'King' Arthur Pendragon

Input Specification

The only line of input is a phrase with only lowercase letters and spaces no longer than n (1 \le n \le 10^5) characters in length.

Output Specification

Output the phrase translated to the language of the Lady of the Lake.

Sample Input

hot dog

Sample Output

hvy tzo

Comments

There are no comments at the moment.