#K68457. Transform String by Shifting Alphabets
Transform String by Shifting Alphabets
Transform String by Shifting Alphabets
Given an integer \(s\) and a string \(S\), transform the string by shifting each alphabetical character by \(s\) positions in a circular manner. The transformation preserves the case of the letters and leaves non-alphabetical characters unchanged.
The formula for shifting an uppercase letter \(C\) is given by:
\[ C' = \left( (C - 'A' + s) \mod 26 \right) + 'A' \]Similarly, for a lowercase letter \(c\):
\[ c' = \left( (c - 'a' + s) \mod 26 \right) + 'a' \]Your task is to read the input from standard input (stdin) and output the transformed string to standard output (stdout).
inputFormat
The input consists of two lines:
- The first line contains an integer \(s\) representing the shift value.
- The second line contains the string \(S\) to be transformed.
outputFormat
Output a single line containing the transformed string.
## sample3
Hello, World!
Khoor, Zruog!