Time limit
2s
Memory limit
256 MB
You are given a plaintext string made of lowercase English letters and spaces, and an encryption key made of lowercase English letters.
The key is matched to the plaintext from the first character. If the plaintext is longer than the key, repeat the key from the beginning. A space in the plaintext also consumes one key character, but the space itself is printed unchanged.
For each lowercase letter in the plaintext, take the 1-based alphabet position of the matching key letter (a = 1, b = 2, ..., z = 26) and move that many letters backward in the alphabet. If the movement goes before a, continue from z.
Print the encrypted string.
The first line contains the plaintext.
The second line contains the encryption key.
The plaintext consists only of lowercase English letters and spaces, and its length, including spaces, is at most 30000. The key consists only of lowercase English letters.
Print the ciphertext on one line.