#K83842. Alphabet Shift by Two Positions

    ID: 36287 Type: Default 1000ms 256MiB

Alphabet Shift by Two Positions

Alphabet Shift by Two Positions

You are given a string and your task is to shift each alphabetical character forward by two positions in the alphabet. If the shift passes 'z' or 'Z', it wraps around to the beginning of the alphabet.

For lowercase letters, the transformation can be described by the formula: $$c' = \text{chr}(((\text{ord}(c)-\text{ord}('a')+2) \bmod 26)+\text{ord}('a'))$$. Similarly, for uppercase letters, use the corresponding uppercase bounds. All non-alphabetic characters should remain unchanged.

For example:

  • Input: "abc" → Output: "cde"
  • Input: "XYZ" → Output: "ZAB"
  • Input: "Hello, World!" → Output: "Jgnnq, Yqtnf!"

inputFormat

The input consists of a single line read from standard input. This line is a string which may contain uppercase and lowercase letters, digits, spaces, and punctuation marks.

outputFormat

Output the transformed string on a single line to standard output. The output should be exactly the input string with each alphabetical character shifted forward by two positions.

## sample
abc
cde