407098: GYM102697 069 Word Rotation

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

069. Word Rotationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Bob is attempting to encrypt information so that only those he trusts with the secret code can decode his secret information. Instead of using a highly secure encryption method, bob uses a method called rotation, where he shifts each letter of his phrase a certain number of characters up or down. This shift works by moving the character up and down the alphabet, so the character 'a' shifted by 5 would become 'f'. A shift also wraps around the alphabet, so if you were to shift 'a' by -5, it would become 'v'. In addition, a character can be shifted by values greater than 26, so for example 'a' shifted by 30 would become 'e', wrapping all the way back around the alphabet. To solve this problem, you will be given a single lowercase string and a series of rotations, with each rotation corresponding to the character in the string with the same index. Perform each rotation on each character and determine what the resulting string would be.

Input

The first line contains a single lowercase string of length $$$N$$$ with no spaces that represents the text to be rotated. The next line contains $$$N$$$ space-separated integers that represent the shift performed on the corresponding character of the original string.

Output

A single lowercase string that represents the original string after performing the shifts.

ExampleInput
agjnp
7 -2 54 -80 25
Output
hello

加入题单

算法标签: