#K60217. Caesar Cipher Encoder

    ID: 31038 Type: Default 1000ms 256MiB

Caesar Cipher Encoder

Caesar Cipher Encoder

Your task is to implement a function that encodes a given plaintext by shifting each letter by a fixed integer shift. The shifting follows the Caesar cipher method where each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet.

For lowercase letters, the transformation follows the formula: $$\text{new\_char} = \text{chr}(((\text{ord}(char) - \text{ord}('a') + shift) \mod 26) + \text{ord}('a'))$$. A similar formula applies for uppercase letters. All non-alphabetic characters remain unchanged.

Note: The shift value can be positive, negative, or zero. The encryption is cyclic modulo 26.

inputFormat

The input is provided via standard input. The first line contains an integer shift representing the shift amount. The second line contains the plaintext string that needs to be encoded. The plaintext may include spaces and punctuation.

outputFormat

The output should be the encoded message printed to standard output.

## sample
1
abc XYZ
bcd YZA