#K11336. Decoding an Encoded Message
Decoding an Encoded Message
Decoding an Encoded Message
You are given an encoded string consisting of alphabetical characters, digits, and other symbols. Your task is to decode the string using the following rules:
- Every alphabetical character (both uppercase and lowercase) is replaced with the character that appears three positions later in the alphabet. If the shift passes 'Z' or 'z', it wraps around to the beginning. This can be expressed mathematically as:
\( c' = (c - A + 3) \mod 26 + A \) for uppercase and \( c' = (c - a + 3) \mod 26 + a \) for lowercase. - Every numeric character (0-9) is replaced with the character that appears three positions later in the sequence. If the shift passes '9', it wraps around to '0'. Mathematically:
\( d' = (d - 0 + 3) \mod 10 + 0 \) - Any other characters remain unchanged.
For example, the encoded string "abcXYZ123!?" would be decoded as "defABC456!?".
inputFormat
The input consists of a single line containing a string. The string may include letters, digits, and other symbols.
Input is provided via standard input.
outputFormat
Output the decoded string to standard output.
## sampleabcXYZ123!?
defABC456!?
</p>