We have a string S consisting of uppercase English letters. Additionally, an integer N…
- User
We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.
Shift each character of S by N in alphabetical order (see below), and print the resulting string.
We assume that
AfollowsZ. For example, shiftingAby 2 results inC(A\toB\toC), and shiftingYby 3 results inB(Y\toZ\toA\toB).Constraints
- 0 \leq N \leq 26
- 1 \leq |S| \leq 10^4
- S consists of uppercase English letters. Input
Input is given from Standard Input in the following format:
N S
Output
Print the string resulting from shifting each character of S by N in alphabetical order.
Examples
Input
2 ABCXYZ
Output
CDEZAB
Input
0 ABCXYZ
Output
ABCXYZ
Input
13 ABCDEFGHIJKLMNOPQRSTUVWXYZ
Output
NOPQRSTUVWXYZABCDEFGHIJKLM
Assistant
pythonn = int(input()) s = input().strip() shift = n % 26 result = [] for c in s: original = ord(c) - ord('A') new_ord = (original + shift) % 26 new_c = chr(new_ord + ord('A')) result.append(new_c) print(''.join(result))
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.