406331: GYM102365 A Abnormal Words

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Abnormal Wordstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

"Khoor!" David exclaimed to Aram.

"Jreeohghbjrrn!" Aram responded.

Dismayed to find that club members weren't sufficiently confused, Aram and David decided to speak in a new language. Rather invent one from scratch, they decided to encode their speech with a Caesar cipher.

Specifically, they agree on the Caesar shift $$$s$$$. To say a word, they replace each of its letters by the letter that comes $$$s$$$ places later in the alphabet. Letters that pass z wrap back around to a. For example if $$$s=4$$$, a becomes e, b becomes f, and y becomes c.

Encoding and decoding words in their heads is very slow, so David and Aram asked you to write a program to automate this process. After all, they're still untangling their tongues after saying jreeohghbjrrn!

Input

The first line contains a single character, either "E" or "D", indicating whether Aram and David are requesting a word to encode or decode, respectively.

The second line contains a integer $$$s$$$ ($$$1 \le s \le 25$$$), the shift.

The third line contains a single word $$$w$$$ ($$$1 \le |w| \le 100$$$) consisting solely of the lowercase Latin letters from a to z.

Output

On a single line output the encrypted or decrypted word, as requested.

ExamplesInput
E
3
hello
Output
khoor
Input
D
3
jreeohghbjrrn
Output
gobbledeygook

加入题单

上一题 下一题 算法标签: