#C11695. Right-Shift Caesar Cipher

    ID: 41039 Type: Default 1000ms 256MiB

Right-Shift Caesar Cipher

Right-Shift Caesar Cipher

You are given a message consisting of only lowercase English letters and an integer shift value. Your task is to encode the message using a right-shift Caesar cipher. In this cipher, each letter in the message is shifted to the right by a fixed number of positions in the alphabet. If the shift passes beyond 'z', it wraps around to the beginning of the alphabet.

The transformation for each character c can be described by the formula:

$$new\_char = \text{chr}(((\text{ord}(c) - \text{ord}('a') + shift) \mod 26) + \text{ord}('a')) $$

For example, shifting 'a' by 3 results in 'd', and shifting 'xyz' by 3 results in 'abc'.

inputFormat

The input is given from stdin and consists of two lines:

  • The first line contains a non-empty string of lowercase English letters representing the message.
  • The second line contains an integer representing the shift value.

outputFormat

Output the encoded message (the result of applying the right-shift Caesar cipher to the input message) to stdout.

## sample
hello
0
hello