GCTAA Logo

Governor's Career & Technical Academy Arlington

Caesar Cipher


Caesar Cipher

One of the early encryption techniques is the Caesar cipher, named after the famous Roman emporer who used it.

While it provides no cryptographic security against modern decryption techniques, it is easy to implement and provides a nice historical way to introduce to this very important field of study.

Input

The first line of the input will be an integer (from 0 to 25), which will be the key. The rest of the input will be lines that contain the message to encrypt. Each of the remaining lines will contain less than 80 characters. Your program should stop when a line contains the only the word STOP.

Output

The output should be a series of encrypted lines, with all upper and lower case letters shifted by the number given in the key places to the right, with z wrapping around to a. Characters that are not upper or lower case letters should be left unchanged.

Example

Example input could contain:

1
The quick brown fox jumped over the lazy dogs
numbers and other things 1, 2, and 3!
STOP

Given this input above, the program would print out:

Uif rvjdl cspxo gpy kvnqfe pwfs uif mbaz epht
ovncfst boe puifs uijoht 1, 2, boe 3!

Test Data