#K76737. Alphabetic Shift

    ID: 34709 Type: Default 1000ms 256MiB

Alphabetic Shift

Alphabetic Shift

Given an integer (n) and a string (s), shift every alphabetic character in (s) forward by (n) positions in the alphabet with wrap-around. Both lowercase and uppercase letters must be shifted according to their case, while non-alphabetic characters remain unchanged. For example, when (n = 3) and (s = \texttt{abcXYZ123}), the output should be (\texttt{defABC123}).

inputFormat

The input is given via standard input (stdin) and consists of two lines. The first line contains an integer (n), representing the number of positions to shift. The second line contains the string (s) which may include letters and other characters.

outputFormat

Output the transformed string to standard output (stdout) after shifting every alphabetic character by (n) positions with appropriate wrap-around.## sample

3
abc
def