#B4303. Letter Shifting Operations

    ID: 11959 Type: Default 1000ms 256MiB

Letter Shifting Operations

Letter Shifting Operations

Given a string (s) of lowercase letters with length (n) and (n) positive integers (a_1, a_2, \ldots, a_n), perform the following operations on (s):

1. Shift the 1st character of (s) to the left by (a_1) positions;
2. Shift the 1st and 2nd characters to the right by (a_2) positions;
3. Shift the 1st, 2nd, and 3rd characters to the left by (a_3) positions;
4. Shift the 1st, 2nd, 3rd and 4th characters to the right by (a_4) positions;

This pattern continues until all (n) characters have been processed. A left shift means moving backward in the alphabet and wrapping around (i.e. (\texttt{a}) shifted left by 1 becomes (\texttt{z})), while a right shift moves forward and wraps around (i.e. (\texttt{z}) shifted right by 1 becomes (\texttt{a})).

Output the final string after all operations.

inputFormat

The input consists of three lines:

- The first line contains an integer (n), the length of the string.
- The second line contains the string (s) consisting of (n) lowercase letters.
- The third line contains (n) space-separated positive integers, (a_1, a_2, \ldots, a_n).

outputFormat

Output the final string after performing all the specified operations.

sample

5
abcde
1 3 5 7 9
vxvbv